Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CF not checking right

Status
Not open for further replies.

GUJUm0deL

Programmer
Jan 16, 2001
3,676
US
Hey everyone, this is my situation: I have this CF file,that checks the EIN number from the database and matches that to a drop-down list (specific EIN numbers go to specific drop-down choices), the problem is CF only checks if thr EIN number is valid and not if the number matches the drop-down choice. How can I make it so that CF will check for both conditions??
condition is EIN numberanddrop-down menu choice match, if they do NOT match then they go to page1, IF they do match then they go to page2...
I tried a CFIF statement but that didn;t work, I also tried changing the SQL code but go no where...
Thanx ppl... I have not failed; I merely found 100,000 different ways of not succeding...
 
i don't know how to do this in cfscript
but still, you can do the same think using javascript :

if ( isEINnumber(number) && number == document.formname.selectname.options[document.formname.selectname.selectedIndex].value )
document.location.href=page2
else
document.location.href=page1

where
- page1 and page2 are proper urls
- isEINnumber(number) is a javascript function returning TRUE if number is a EIN number
- in your html page, the form name is formname, the select name is selectname
- and the drop down's value you're checking against is specified in the VALUE part of the option tag

<form name=formname>
<select name=selectname>
<option value=&quot;this is me you're comparing to&quot;>anything</option>
</select>
</form>


this is ie only
let me know if you're targetting ns and are interested in using javascript





 
iza, Hi, I'd have to check with the people who want the page to see if they want JS coding or not...i'll get back to you...
Thanx man... I have not failed; I merely found 100,000 different ways of not succeding...
 
gj, i think it can be done with cf script, but i'm not good enough at it to fully help you - hopefully someone else here can ??
anyway, the cf should look like this (becareful this has to be on the called page, as it's server side, whereas the javascript i gave you before has to be on the calling page (the one with the form on it) as it's client side)
<cfif isEINnumber(your_number) AND your_number==form.selectvalue>
<cflocation ... page2>
<cfelse>
<cflocation ... page1>
</cfif>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top