PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

validation and default value

  1. Greetings

    I have a form with a text field for name,
    I don't want to have a label for the field (so that in CSS I use a display none)
    in the advanced section of the field editor I use the 'default value' that prepoluate the field with the value 'name'

    my problem now is that if the user press the submit menu without changing 'name' to his name, the field will still validate

    how can I do to avoid that behaviour while still using the default value, is there a blacklist word or something similar that would make the field not validate?

    I face the very same problem with a select menu where I have used

    [php
     //Creating drop down item array.
        $items = array();
    
        //Adding initial blank value.
        $items[] = array("text" => "Select the destination", "value" => "");
    	$items[] = array("text" => "----------------------", "value" => "");

    if people don't select a value, then it is a blank value, but still it validates

    Thank you in advance for your assistance

    Posted 10 years ago on Sunday December 18, 2011 | Permalink
  2. Please see this:
    http://www.gravityhelp.com/forums/topic/required-fields-1#post-27364

    You can enable values and leave the value blank for the first option. Does that help you?

    Posted 10 years ago on Tuesday December 20, 2011 | Permalink
  3. Greetings Chris

    Thank you for your answer

    I have been to the link, and I already followed the advise to enable value blanck for the first option.
    that is actually what I did on the code I sent here.
    but it seems that it auto feed the option value

    //Adding initial blank value.
        $items[] = array("text" => "Select the destination", "value" => "");
    	$items[] = array("text" => "----------------------", "value" => "");

    I thought that would have print me

    <option value='' >Select the destination</option>
    <option value='' >----------------------</option>

    and THAT would have fired me an error, I guess

    BUT
    actualy it prints me the following

    <option value='Select the destination' >Select the destination</option>
    <option value='----------------------' >----------------------</option>

    which validate

    any idea why my snipet does not work? why the option value is auto poluated with the "text" value

    thank you in advance for your help

    Posted 10 years ago on Tuesday December 20, 2011 | Permalink
  4. no idea? I'm stuck here and I have hard time to understand why values are not blank

    Posted 10 years ago on Thursday December 22, 2011 | Permalink
  5. Can you export that form as XML and email it to me at chris@rocketgenius.com and I will take a look at it? Thanks

    Posted 10 years ago on Friday December 23, 2011 | Permalink
  6. Hi Chris,
    thank you very much
    message sent
    thanks a lot

    Posted 10 years ago on Friday December 23, 2011 | Permalink