Hidden fields do not seem to hold pre-populated values when looking through source code

  • Profile Image
    Asked on August 10, 2015 at 03:06 PM

    Hi, this issue seems to still exist, if I take this form above and pass in the values like this:




    If I view the source the hidden fields don't appear to have any values in the form, what am I missing? Thanks!

  • Profile Image
    Answered on August 10, 2015 at 04:35 PM

    Please do note that fields, will hold the value, but if they get the value after they are being created, they will not show you the value attribute in their source.


    <input id="input_7" class="form-hidden" type="hidden" name="q7_typehidden7" value="Start Yachting"></input>

    <input id="input_8" class="form-hidden" type="hidden" name="q8_datehidden8" value="2013-06-28"></input>

    <input id="input_30" class="form-hidden" type="hidden" name="q30_formathidden30" value="Fri-Sun, Nights"></input>

    <input id="input_9" class="form-hidden" type="hidden" name="q9_pricehidden9" value="185"></input>

    <input type="hidden" name="event_id" value="1439237786947_31955116403954_LWB68LJ"></input>

    Is possible in some cases, but should not be expected.

    The reason why is that this value, is not shown in the source code that you get by pressing CTRL + U, but might be included in the source code shown to you by some developers tool - as it is dynamically created like that).

    If you wish you can always fire few JS calls to test this on your form, by using any of the tools that you are familiar and running something like:

    document.getElementById('input_7').value; to get the value of typehidden7 which was Start Yachting.