The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
|
demo sample http://www.benjaminkeen.com/software/rsv/standalone/demo.php?page=7 - Printable Version +- Form Tools (https://forums.formtools.org) +-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1) +--- Forum: General Discussion (https://forums.formtools.org/forumdisplay.php?fid=5) +--- Thread: demo sample http://www.benjaminkeen.com/software/rsv/standalone/demo.php?page=7 (/showthread.php?tid=1524) Pages:
1
2
|
demo sample http://www.benjaminkeen.com/software/rsv/standalone/demo.php?page=7 - wout - Aug 10th, 2011 Hello, Because IPAD is not for flash I have to make a multiple form in html/php. I have made one in flash: http://www.villacosta.nl/huis_kopen_spanje-wensenpakket.html. Now I started with the example: http://www.benjaminkeen.com/software/rsv/standalone/demo.php?page=7 When I follow the instructions I get errors: When I set:if (errorInfo.length == 0); return false;, the validation works fine but when I submit it doesn't go to the neaxt page. When I set:if (errorInfo.length == 0); return true;, there's no validation but then I can go to the next page. I hope someone has a solution. Here's the code: <?php require_once("/home/vhosts/villacosta.nl/httpdocs/cms/global/api/api.php"); $fields = ft_api_init_form_page("", "test"); $params = array( "submit_button" => "continue", "next_page" => "stap7.php", "form_data" => $_POST ); ft_api_process_form($params); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Stap 1</title> <meta name="keywords" content="RSV,Really Simple Validation,form validation,validation,Benjamin Keen,Ben Keen"> <script type="text/javascript" src="rsv.js"></script> <link rel="stylesheet" type="text/css" href="styles.css"> <script type="text/javascript"> rsv.displayType = "display-html"; rsv.customErrorHandler = myCustomErrorDisplayFunction; var rules = []; rules.push("required,naw1,Aanhef?"); rules.push("required,naw2,Please enter your first name."); rules.push("required,naw3,Please enter your last name."); rules.push("required,naw10,Please enter your email address."); rules.push("valid_email,naw10,Please enter a valid email address."); function myCustomErrorDisplayFunction(f, errorInfo) { // disabled all errors by default for (var i=0; i<rules.length; i++) { var parts = rules[i].split(","); var fieldName = parts[1]; document.getElementById(fieldName + "_label").style.color = "#000000"; document.getElementById(fieldName + "_error").style.display = "none"; } for (var i=0; i<errorInfo.length; i++) { var fieldName; // radio button if (errorInfo[i][0].type == undefined) fieldName = errorInfo[i][0][0].name; else fieldName = errorInfo[i][0].name; // display the error document.getElementById(fieldName + "_label").style.color = "#cc0000"; document.getElementById(fieldName + "_error").style.display = "block"; document.getElementById(fieldName + "_error").innerHTML = errorInfo[i][1]; } if (errorInfo.length == 0); return false; } </script> </head> <body> <table class="table_1" cellpadding="2" cellspacing="1" width="960"> <tr> <td colspan="3" class="table_1_bg"> <table cellpadding="0" cellspacing="0" width="100%"> <tr> <td class="table_1_title">CONTACT INFO</td> </tr> </table> </td> </tr> <tr> <td width="960"> <form action="<?=$_SERVER['PHP_SELF']?>" method="post" onSubmit="return rsv.validate(this, rules)"> <a name="contact_info"></a> <table cellpadding="0" cellspacing="1" width="100%"> <tr> <td valign="top" class="red" width="10">*</td> <th align="left" valign="top" id="naw1_label" width="130">Aanhef</th> <td class="answer" width="300"> <input type="radio" id="ms1" name="naw1" value="heer" <?php if (@$fields['naw1'] == "yes") echo "checked"; ?>/><label for="ms1">heer</label><br/> <input type="radio" id="ms2" name="naw1" value="mevrouw" <?php if (@$fields['naw1'] == "yes") echo "checked"; ?>/><label for="ms2">mevrouw</label> </td> <td valign="top"> <span id="naw1_error" class="custom_error"></span> </td> </tr> <tr> <td valign="top" class="red">*</td> <th align="left" id="naw2_label">Voornaam</th> <td class="answer"> <input type="text" name="naw2" value="<?=@$fields['naw2']?>" size="50"/> </td> <td> <span id="naw2_error" class="custom_error"></span> </td> </tr> <tr> <td class="red">*</td> <th align="left" id="naw3_label">Achternaam:</th> <td class="answer"> <input type="text" name="naw3" value="<?=@$fields['naw3']?>" size="50"/> </td> <td> <span id="naw3_error" class="custom_error"></span> </td> </tr> <tr> <td class="red">*</td> <th align="left" id="naw10_label">Email</th> <td class="answer"> <input type="text" name="naw10" value="<?=@$fields['naw10']?>" size="50"/> </td> <td> <span id="naw10_error" class="custom_error"></span> </td> </tr> </table> <p> <input type="submit" name="continue" value="Continue" /></p> </form> </td> </tr> </table> </body> </html> RE: demo sample http://www.benjaminkeen.com/software/rsv/standalone/demo.php?page=7 - Ben - Aug 11th, 2011 Hi Wout! Change the last part of your function to this: Code: // ... What that does is only prevent the form from submitting if there were errors. Otherwise, it explicitly returns true, which lets the form submit. (and sorry for the long response time!) All the best - Ben RE: demo sample http://www.benjaminkeen.com/software/rsv/standalone/demo.php?page=7 - wout - Aug 16th, 2011 Hello Ben, Thank you for your help, it works now. I have made a form with your example on formtools. You can see it at http://www.villacosta.nl/wp/index.php(7 steps including thank you). Everything works fine but on the review page with the link edit(bewerk) to go back to one step all the checkboxes where empty altough I filled them in. I have looked on tis forum but I think I did it the right way. Mabye you have any suggestions? By the way I try to use the newest formtools 2.1 after deleting all the sources from the version 2.0.6 but I think there are bugs in it. But mabye I'm wrong. I did go back to version 2.06. Anyway thanks! RE: demo sample http://www.benjaminkeen.com/software/rsv/standalone/demo.php?page=7 - Ben - Aug 16th, 2011 Hi Wout, What bugs did you encounter with 2.1.0 before going to 2.0.6? Regarding re-filling fields, check out this tutorial: http://docs.formtools.org/tutorials/api_refilling_form_fields/ It explains how to re-fill form fields in your form for when the user returns to the page. - Ben RE: demo sample http://www.benjaminkeen.com/software/rsv/standalone/demo.php?page=7 - wout - Aug 16th, 2011 Hello Ben, Thank you for your answer, I shall try to make it work. The following problems I get when version 2.1 was installed, before I have deleted the database and all the sources on the server: - fields missing like edit for example - add form did not work Mabye I did something wrong? regards, Wout RE: demo sample http://www.benjaminkeen.com/software/rsv/standalone/demo.php?page=7 - Ben - Aug 16th, 2011 Maybe, but you never know! If you do end up using 2.1 and run into trouble, do let me know. - Ben RE: demo sample http://www.benjaminkeen.com/software/rsv/standalone/demo.php?page=7 - wout - Aug 16th, 2011 Hello Ben, I finished my form now with 2.0.6. And it works great! The email template generator works perfect! I have one more question: can I change the format of submission_date? I'm going to try the newest version later. Great tools, altough the translation of the Dutch language can be better. Mabye when I have more time I'm gonna translate it. Thanks again. Wout RE: demo sample http://www.benjaminkeen.com/software/rsv/standalone/demo.php?page=7 - wout - Aug 17th, 2011 Hello Ben, I have solved the problem with the date format with the link after de date field to the php info. Thanks, regards Wout RE: demo sample http://www.benjaminkeen.com/software/rsv/standalone/demo.php?page=7 - Ben - Aug 17th, 2011 Good to hear! All the best - Ben RE: demo sample http://www.benjaminkeen.com/software/rsv/standalone/demo.php?page=7 - wout - Aug 21st, 2011 Hello Ben, I hope you don't mind but I have one more question. When I fill in a multipage form or another form it appears in the database. But there are often more ID's with NULL. So although I started with the first submission, the ID is for example 11 en there are 10 ID's with NULL? Mabye I have used the wrong text in the formpages. Are the names continue and add for the form process needed? Regards Wout |