Any thoughts?"> Custom PHP not showing in 2nd Step - Forums

Forums

Custom PHP not showing in 2nd Step

jenstechs 01 Sep, 2009
I am having an issue with using PHP in Step 2 of a multi-page form. I have custom PHP, including drop-down menus and filling in a text field with the current time stamp, which works perfectly fine when the form is visited independently. However, when I get to the form as the second step of a multi-page form, the PHP - particularly the timestamp - doesn't work.


<div class="form_item">
  <div class="form_element">
    <label class="cf_label" style="width: 150px;">Signed On*</label>
    <input class="cf_inputbox required" title="*" size="20" id="coc_dateSigned" name="coc_dateSigned" type="text" value="<? echo date('Y-m-d H:i:s'); ?>" readonly="readonly"/>
    
  </div>
  <div class="cfclear"> </div>
</div>


Any thoughts?
jenstechs 01 Sep, 2009
Another issue I'm running into with multi-page forms:

I need to update the code in the second page of the form, so I go to edit it, but the changes don't seem to be making it to the page when I go to it. And when I view the source, the HTML looks different than what I see in the individual form!

There are no conflicts with form element names/ids because I was very careful to name everything different...
GreyHead 01 Sep, 2009
Hi jenstech,

I can't see any obvious reason why this code wouldn't work. Where exactly are you putting it? Is this a multi-page form using the Multi-Page plugin i.e. the code is in the Form HTML box of the second child form?

Bob
jenstechs 01 Sep, 2009
Hi Bob,

Yes, that code snippet I posted is in the "Form Code" box of the second step of the multi-page form. The code works fine when the form is accessed individually, but not when accessed as a step. I'm also not entirely sure the code is even processing correctly or updating when I make changes to the second form. For example, when I view the source of Page 2, one of the select/option elements (the first one) has selected="selected" TWICE, even though in my code it's only once. Also, one of the PHP dropdown boxes doesn't even exist! .... Ohhhh although I may know why that's the case now...

Hang on a few, I'll check something, then come back.😉
jenstechs 01 Sep, 2009
Okay..

I figured out why one of my dropdown boxes wasn't showing up. I was calling it with require_once and it was the second time the file was called (being a states dropdown list) so of course it wasn't showing up. Duh.😉 Changing it to include worked fine.

I tested the same timestamp code in a different, step-2 form, and it worked fine. Which doesn't explain why it doesn't work in the other form code, but at least I know I'm on the right track...

I still don't understand some of my other code anomalies - for example, why selected="selected" was showing up twice, but perhaps that was a fluke?

I'll see what I can discover...
This topic is locked and no more replies can be posted.