The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
|
![]() |
Fields Variable is Empty after Validation with Error - Printable Version +- Form Tools (https://forums.formtools.org) +-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1) +--- Forum: API (https://forums.formtools.org/forumdisplay.php?fid=17) +--- Thread: Fields Variable is Empty after Validation with Error (/showthread.php?tid=1326) |
Fields Variable is Empty after Validation with Error - asgaroth - May 24th, 2011 Hey there, i hope this is the right subforum to post my question to. I've got a multipage form using the api. Everything is set up and i think is working okay. The Problem is that if i don't enter all values that are required and submit the page, the fields array is not containing the entered values and therefore they are not reinserted into the form! I already checked that validation is right, that all the form fields are set up like this: Code: <input type="text" name="name" size="30" maxlength="100" value="<?=@$fields['name']?>"/> Here is the header of one of my forms (not the initial page): Code: <?php I already tried the following: 1. Verifying via var_dump that fields is really not containing the input 2. Setting $g_session_type = "database"; in the config 3. Deleting or commenting out rules with commas (because i read that this is unsupported) and with html chars like ü (i need them because i am german). 4. Checked the initial page for a valid ft_api_init_form("", "test"); The var dump contains only things from the first page (there i have only 4 radio buttons to choose from so this initial page is always filled completely): Code: array(4) { ["form_tools_form_id"]=> string(4) "test" ["form_tools_submission_id"]=> string(4) "test" ["profil_prio"]=> string(9) "thing" ["continue"]=> string(6) "Continue" } Thanks in advance for your replies, asgaroth! Hey there, i reviewed the formtools code and found myself a workaround. Here is how it currently works (only tested in testing mode): Code: if (!empty($errors)) I call ft_api_process_form without changing the page (next_page is not required as the comments in the code state) and then i reinitialize fields with ft_api_init_form_page. Do you think i can/should keep this as workaround or is there another possibility? Thanks in advance, asgaroth |