The ToString would do it's work before it got to the browser so it's probably something else.
View the source of the page and see if all the functions and calls to functions are named correctly. Adrian -----Original Message----- From: Jessica Kennedy [mailto:[EMAIL PROTECTED] Sent: 10 September 2008 18:18 To: CF-Talk Subject: Re: dynamic js field verification Well, the CF seems to be functioning properly, so I suppose the js is the problem. I am not getting any error messages, however. I don't think the function is running at all, as I added a popup message to either scenario and still got no results. The tostring() i had to add because i was getting a javascript error message saying that a numeric value was trying to be used as a string (most of my vars are numbers). >What's not working, JS, CF? What does the source look like in the browser? > >Some tips for you... you don't need the ToString() calls in CF and it's >Javascript not Java (big difference). > >Adrian > >Hi, I am working on a page where an admin would enter an id number for one >or more of a list of people. as it is important that the numbers match, I >am making a verification field to check the numbers match. All fine and >dandy, however I would like to have js check this before the form is >submitted. The code I have is not working, I am guessing it has to do with >naming the function, but I am pretty much a complete newbie to java. how >can I make this work? > ><cfoutput query="rscards"> ><!---Convert int to string for java---> ><cfset chk="chk"&tostring(rscards.dealerid)> ><cfset javaint=tostring(rscards.dealerid)> ><cfset java="java"&tostring(rscards.dealerid)> > ><cfinput type="text" name="#javaint#" id="#javaint#" value="" >onvalidate="#java#" /> <cfinput type="text" name="#chk#" value="" id="#chk#" >message="oops" onvalidate="#java#" />#rscards.first_name# >#rscards.last_name# #rscards.dealerid#<br /> > ><script type="text/javascript"> >function #java#(form) { >if(form.#javaint#.value == form.#chk#.value) { >return true; >} >else { >alert("Error: #rscards.first_name# #rscards.last_name#'s info does not >match."); >form.#chk#.focus(); >return false; >} >} ></script> > ></cfoutput> > ><cfinput type="submit" value="Submit" name="submit" /> ></cfform> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;203748912;27390454;j Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:312340 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

