Truly Posted May 14, 2007 Share Posted May 14, 2007 Hi guys, really stupid question for you.I am validating a textbox, making sure that no one has '.' or '/' in it. If its true that neither of those characters exist then I want it to add '.php' to the end but I cant remember how. Im thinking it would be something like this:document.formname.textboxname=.documnent.formname.textboxname+".php"Im more of a php guy myself so any help would be appreciated . Link to comment Share on other sites More sharing options...
aspnetguy Posted May 14, 2007 Share Posted May 14, 2007 I would recommend adding the id attribute to your form elements (ie <input type="text" name="txtField" id="txtField"/>)Then you can do this var txt = document.getElementById("txtField");txt.value = txt.value + ".php"; Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.