Thanks that last little /g did it ;)
-----Original Message----- From: Matthew Walker [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 09, 2002 5:04 PM To: CF-Talk Subject: RE: Javescript help Check this out http://www.webreference.com/js/column5/ :-) > -----Original Message----- > From: Bruce, Rodney S HQISEC/SIGNAL > [mailto:[EMAIL PROTECTED]] > Sent: mercredi 10 juillet 2002 11:56 > To: CF-Talk > Subject: RE: Javescript help > > > getting closer anyway > document.bldginfo.Bldgnumt.value.replace(/[0-9]/, '') > will replace the first non number. > > thanks for the start > > -----Original Message----- > From: Matthew Walker [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, July 09, 2002 4:38 PM > To: CF-Talk > Subject: RE: Javescript help > > > REReplaceNoCase() is a CF function. Regex in JS works something like > this: > > document.bldginfo.Bldgname.value = > document.bldginfo.Bldgnumt.value.replace('[0-9]', '') > > But I'm no expert. A JS list could help you. > > > -----Original Message----- > > From: Bruce, Rodney S HQISEC/SIGNAL > > [mailto:[EMAIL PROTECTED]] > > Sent: mercredi 10 juillet 2002 11:29 > > To: CF-Talk > > Subject: RE: Javescript help > > > > > > I am trying to write it in javascript, but am not getting the > > JS reg exp > > right. > > and maybe confusion the regexp. > > > > My code was: > > <script language="JavaScript"> > > function enterbldgnum() { > > document.bldginfo.Bldgname.value = > > REReplaceNoCase(document.bldginfo.Bldgnumt.value, > > "[:digit:]", "", "All"); > > } > > > > </script> > > <body> > > <form name="bldginfo"> > > <input name="bldgnumt.... onChange="enterbldgnum()"> > > <input name="bldgname"...> > > </form> > > </body> > > > > which has no CF in it (well maybe the REReplaceNoCase()). > > <cfscript></cfscript> it is not. > > this function is with all the rest of the JS functions at the > > top of my > > page. > > I am far from an expert(or I wouldn't need this help), but I > > do know the > > differnce between CF and JS and were they run. > > > > So my question still stands how would I get this to work in JS? > > > > > > > > > > > > -----Original Message----- > > From: Matthew Walker [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, July 09, 2002 4:17 PM > > To: CF-Talk > > Subject: RE: Javescript help > > > > > > You are confusing server-side (CF) and client-side (JS). > While you can > > mix CF and JS together, you need to understand how it > works. The CF is > > processed in entirety before the page loads. So you can use > > it to insert > > values into JS variables for example, or to dynamically build > > different > > JS code. But CF cannot access client-side variables such as > > document.bldginfo.Bldgnumt.value . > > > > JS has regular expression parsing so perhaps you can > rewrite it all in > > JS. > > > > > -----Original Message----- > > > From: Bruce, Rodney S HQISEC/SIGNAL > > > [mailto:[EMAIL PROTECTED]] > > > Sent: mercredi 10 juillet 2002 11:05 > > > To: CF-Talk > > > Subject: OT: Javescript help > > > > > > > > > Hello all > > > > > > I am missing something to get this javascript to work, hoping > > > someone can > > > help. > > > > > > Am just trying to remove all but numbers from a form field > > > and then enter > > > the new var into a differnt field. > > > > > > I have tried: > > > > > > <script language="JavaScript"> > > > function enterbldgnum() { > > > document.bldginfo.Bldgname.value = > > > REReplaceNoCase(document.bldginfo.Bldgnumt.value, > > > "[:digit:]", "", "All"); > > > } > > > > > > function enterbldgnum() { > > > x = document.bldginfo.Bldgnumt.value; > > > document.bldginfo.Bldgname.value = REReplaceNoCase(x, > > > "[:digit:]", > > > "", "All"); > > > } > > > > > > function enterbldgnum() { > > > x = REReplaceNoCase("22we445rt", "[:digit:]", "", "All"); > > > document.bldginfo.Bldgname.value = x; > > > } > > > > > > function enterbldgnum() { > > > x = document.bldginfo.Bldgnumt.value; > > > REReplaceNoCase(x, "[:digit:]", "", "All"); > > > document.bldginfo.Bldgname.value = x; > > > } > > > > > > </script> > > > > > > All get the same error "object expected", for the > > > REReplaceNoCase line. > > > this simple check works(just making sure all my names were > > > good and function > > > was being called) > > > > > > function enterbldgnum() { > > > document.bldginfo.Bldgname.value = > > > document.bldginfo.Bldgnumt.value; > > > } > > > > > > > > > What am I missing? > > > Thanks > > > Rodney > > > > > > > > > > > > ______________________________________________________________________ Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

