Popup message

This is a discussion on Popup message within the Cold Fusion forums in Application Servers & Tools category; I have a form that requires a part number to be entered. In my action page, i query against a table using teh part number, <cfquery name="qry" datasource=" db"> select partnumber from table where partnumber = '#form.partNumber# ' </cfquery> If no matches are found, qy.recordcount is 0, I use cflocation to redirect back to the form with a javascript poppup message : <cflocation url="form.cfm? showalert& comingfrom= actionpage" > Back in the form, I check : <cfif isDefined("showAlert ") and comingfrom is "actionpage" > <script language = "javascript" > alert('Part Number not found"> </script> So if the part number enered is ...

Go Back   Application Development Forum > Application Servers & Tools > Cold Fusion

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-27-2008, 12:53 AM
Olivia Crazy Horse
Guest
 
Default Popup message

I have a form that requires a part number to be entered. In my action page, i
query against a table using teh part number,
<cfquery name="qry" datasource=" db">
select partnumber from table
where partnumber = '#form.partNumber# '
</cfquery>

If no matches are found, qy.recordcount is 0, I use cflocation to redirect
back to the form with a javascript poppup message :
<cflocation url="form.cfm? showalert& comingfrom= actionpage" >

Back in the form, I check :
<cfif isDefined("showAlert ") and comingfrom is "actionpage" >
<script language = "javascript" >
alert('Part Number not found">
</script>

So if the part number enered is not found, I display a message back on the
form. Everything works ok except that as soon as the message is cleared (click
ok), it seems to come back when the form is reset or refresh and I get
complaints about that.

How can I eliminate the message once it apppears and the ok button is clicked.
I only want it to popup once and thats it. Also, somebody suggesed I use
showAlert but I have no idea what that does or means.

thanks


Reply With Quote
  #2  
Old 08-27-2008, 09:19 AM
Dan Bracuk
Guest
 
Default Re: Popup message

The reason it's happening is that you have url variables in your cflocation tag
and the page refresh doesn't get rid of them.

One way to handle this is to put your javascript on the action page. You'll
need to lines, one for the pop up and one to send them back from whence they
came.

Reply With Quote
  #3  
Old 08-27-2008, 02:55 PM
SafariTECH
Guest
 
Default Re: Popup message

Another possible way is to use a session variable for the popup trigger and as
part of that trigger's code, clear the session variable after the message is
shown.

If you assign the variable on the action page, then they can refresh the form
as many times as they want after the initial message w/o getting the message
again.

Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 06:17 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.