Forums

display form fields values after error check

rodiusd 09 Oct, 2013
Hi,

going further on a form after SSV i'm stuck with the values not displayed in dropdown boxes and other fields.

I have the following actions:
on Load
- Session to Data (to get the values back)
- Debugger (to see if data is reloaded)
- Load JS (my javascript)
- Show html

on submit
- Data to Session (saving the field values)
- .....

Now the process: I'm getting the errors back displayed. In the debugger i see al previous data correctly in the fields. However in my javascript it seem that no value are yet in the fields loaded.

So when are these values loaded in the html code or I'm i missing something here.
GreyHead 11 Oct, 2013
Hi rodiusd,

What are you trying to do with field values in the JavaScript? You should be able to access them with PHP from the $form->data array.

Bob
rodiusd 11 Oct, 2013
Hi bob,

wel i'm doing something with the values in php; this iw where i'm checking for errors.

initially someform field are not shown and tis i control by JS in the doc load.

Now when the form is submitted and got errors in reload the data from the session and my JS should check if field has values so that they are not hidden but shown.

When i check the values i see that noting is entered in the DOM element.

Maybe i tackle this problem the wrong way, but then do you have an example so that i can follow the right way?
This topic is locked and no more replies can be posted.