Not a cf_solution but still valid.

You could use client side validation for something like this. Change
your input type=submit to type=button with an onclick event that calls a
function that looks something like this:

<!--
function checkit() {
   for (i=0; i < document.myform.myselect.length; i++) {
                if (document.myform.myselect[i].selected == true) {
                        if (document.myform.myselect[i].text ==
'--------------------------------') {
                                alert('Foobar');
                        } else {
                                document.myform.submit();
                        }
                }
        }
}
//-->

-----Original Message-----
From: Jim Priest [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 01, 2000 9:36 PM
To: Fusebox
Subject: help - passing client.message back to index.cfm to display
error msg


Tonight I'm trying to do something that I thought would be simple and
now I'm stumped...

I have a page with 3 drop down selects - in which the user can sort
video game listings by game platform, genre or title.

To make my select boxes pretty the first <option> tag is a line with
no value: <option>--------------------------------</option> which forces all
the boxes to be the same width.

What I'm trying to do is detect if they hit the submit button with the
-------- selected accidently vs. an actual choice. If they do I want
to set client.message and return them to the form with an error
message displayed.  All the valid choices
(getgameplatform) should be passing a number - so...

The user selects a platform and submits which calls
index.cfm?fuseaction=byplatform

<cfcase value="byplatform">
   <cfinclude template="dsp_platform.cfm">
</cfcase>

dsp_platform.cfm contains:

<cfif not val(getgameplatform)>
<cfif NOT isNumeric(getgameplatform)>
        <cfset client.message="FUBAR">
</cfif>
       <cflocation index.cfm>
</cfif>

Which should send them back to my default fuseaction which is
dsp_catelog.cfm which contains:

<cfif isdefined("client.message")>
    <cfoutput>#client.message#</cfoutput>
   <cfset temp=deleteclientvariable("message")>
</cfif>

It loops back to the index.cfm but for some reason doesn't pass along
#client.message#.

I'm trying to copy basically the same thing that is occuring in the
act_login.cfm security layout described in the ebook...

Any idea of what I'm doing wrong here? And how to fix it??

jim


----------------------------------------------------------------------------
--
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/fusebox or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

------------------------------------------------------------------------------
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/fusebox or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to