Jump to content

changing state to VALID if php has passed a value


botcha

Recommended Posts

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?

 

  • 2 weeks later...

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/

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.