Turansky Posted May 8, 2002 Share Posted May 8, 2002 Is there a way to validate this field to be a required field? The javascrpit I use doesn't work with a token. <input name="-Token.7" value="" size=30> Thank you Kent Link to comment Share on other sites More sharing options...
Anatoli Posted May 9, 2002 Share Posted May 9, 2002 JavaScript will validate any input field regardless of destination -- Token or field. What is really the problem? Link to comment Share on other sites More sharing options...
Turansky Posted May 9, 2002 Author Share Posted May 9, 2002 I changed the input field names to a normal name and the javascript works fine. But when I swithch it back to the token name the page passes without checking to see if this field has an input? Is your javascript different than mine to make the token work? Thank you Kent <SCRIPT LANGUAGE="JAVASCRIPT"> <!-- function MustNotBeBlank( theElement ) { if ( theElement.value == "" ) return false; else return true; } function ValidateForm() { msg = ""; formOkay = true; if ( !MustNotBeBlank( document.forms[0].-Token.7 ) ) { msg = msg + "t- Your first name has not been enteredr"; formOkay = false; } if ( !MustNotBeBlank( document.forms[0].-Token.8 ) ) { msg = msg + "t- Your last name has not been enteredr"; formOkay = false; } if ( formOkay ) { return true; } else { alert( "We can not start your registration because rr" + msg + " rPlease enter this information and try again."); return false; } } //--> </SCRIPT> Link to comment Share on other sites More sharing options...
Anatoli Posted May 9, 2002 Share Posted May 9, 2002 I will guess the "-" will have problem with JS. Link to comment Share on other sites More sharing options...
Sharky Posted June 11, 2002 Share Posted June 11, 2002 not when you use: .elements['-Token'] = ... Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 8150 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now