This forum is no longer open and is for reading/searching only.
Please use our new MachForm Community Forum instead.
MachForm Community Forums » MachForm 2
Hidden Fields not being populated
Started 14 years ago by vern1271 | 6 posts |
-
I have 2 Hidden fields on a form. One to capture the referrer and the other for the page url...
I put this in viewfunctions.php:
//Form 9 if($form_id == 16 && $row['element_id'] == 6){ $element[$j]->default_value = $HTTP_SERVER_VARS["HTTP_REFERER"]; } if($form_id == 16 && $row['element_id'] == 7){ $element[$j]->default_value = $HTTP_SERVER_VARS['REQUEST_URI']; }
but when I view the source on the front I see this:
<li id="li_6" > <label class="description" for="element_6"> </label> <div> <input id="element_6" name="element_6" class="element text small" type="text" value="" /> </div> </li> <li id="li_7" > <label class="description" for="element_7"> </label> <div> <input id="element_7" name="element_7" class="element text small" type="text" value="" /> </div> </li>
Now I know the $HTTP_SERVER_VARS["HTTP_REFERER"]; should be empty since i hit the page stright on, but I'm not getting the $HTTP_SERVER_VARS['REQUEST_URI'];
I've tried using <?php echo $HTTP_SERVER_VARS['REQUEST_URI']; ?> on a blank page and it works that way.
What am I doing wrong?
Posted 14 years ago # -
Sorry for delayed response!
Are you using the standard form code or advanced?
MachForm Founder
Posted 14 years ago # -
I'm using the advanced. Thanks.
Posted 14 years ago # -
If you are using the advanced code, make sure to put your code above inside "display_integrated_form()" function.
The code should be placed around line 2021.
MachForm Founder
Posted 14 years ago # -
OK, tried that... still not working.
Posted 14 years ago # -
I see that you've submitted a ticket. We'll reply there.
MachForm Founder
Posted 14 years ago #
Reply
You must log in to post.