botcha Posted January 27, 2012 Share Posted January 27, 2012 http://hirealimo.com.au/index.php?p=limoenquiryform <td> <?php if(!empty($_POST['town'])) { echo '<span id="sprytextfield9">'; echo '<input type="text" name="hirelocation" id="hirelocation" value='. $_POST['town'] . "/>"; } else{ echo '<span id="sprytextfield5">'; echo '<input type="text" name="hirelocation" id="hirelocation"/>'; echo '<span class="textfieldRequiredMsg">A value is required.</span></span>'; } ?> </td> var sprytextfield5 = new Spry.Widget.ValidationTextField("sprytextfield5", "none", {validateOn:["blur"]}); var sprytextfield5 = new Spry.Widget.ValidationTextField("sprytextfield9", "none", {isRequired:false, "VALID"}); i want to make it so that when the TOWN field is passed from another page, that the state is already set to VALID. i think i have the php side of it about right (except for the backslash) the part i have changed and think is where the problem is is the textfield9 bit of , {isRequired:false, "VALID"}); how do i set it to VALID?, do i need the quoation marks? Link to comment https://forums.phpfreaks.com/topic/255862-changing-state-to-valid-if-php-has-passed-a-value/ Share on other sites More sharing options...
zeodragonzord Posted February 6, 2012 Share Posted February 6, 2012 Not sure exactly what you're trying to do, but I noticed a few issues with this code. First, anything within brackets {} should contain option:value that Spry allows. "VALID" is not valid. Second, your second variable has the same name as the first one, sprytextfield5; you probably meant sprytextfield9. What is considered valid for that field? http://labs.adobe.com/technologies/spry/articles/textfield_overview/ Link to comment https://forums.phpfreaks.com/topic/255862-changing-state-to-valid-if-php-has-passed-a-value/#findComment-1315031 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.