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?

 

Link to comment
Share on other sites

  • 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/

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.