The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $newpmmsg - Line: 40 - File: global.php(841) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/global.php(841) : eval()'d code 40 errorHandler->error
/global.php 841 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "style" - Line: 909 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 909 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5024 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 5024 errorHandler->error
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions.php 5044 is_member
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Form Tools
Validation help for a NooB (JS?) - Printable Version

+- Form Tools (https://forums.formtools.org)
+-- Forum: Modules / Other (https://forums.formtools.org/forumdisplay.php?fid=8)
+--- Forum: Form Validation: JS + PHP (https://forums.formtools.org/forumdisplay.php?fid=18)
+--- Thread: Validation help for a NooB (JS?) (/showthread.php?tid=21714)



Validation help for a NooB (JS?) - eris667 - Feb 25th, 2017

I have created a form, and it is working great!
The only thing I would like to do is prevent duplicate text box entries for a certain field (empire_name)

The form is FormBuilder type, Published

For what I am reading I need to use the JS validation method?
https://docs.formtools.org/userdoc/field_validation/?page=edit_field_dialog
https://docs.formtools.org/tutorials/js_validation/

How / Where do I make the changes?
I seem to be missing something, probably simple....

Thanks!

Mike


RE: Validation help for a NooB (JS?) - eris667 - Mar 4th, 2017

Bump?
Still trying to figure this out...


RE: Validation help for a NooB (JS?) - eris667 - May 1st, 2017

Bump?


RE: Validation help for a NooB (JS?) - nelsondcosta - Aug 23rd, 2017

baaah tool its great but support its very hard :S
it should be a premium support Tongue


RE: Validation help for a NooB (JS?) - ocbroadband - Nov 2nd, 2017

(May 1st, 2017, 1:02 PM)eris667 Wrote: Bump?

Is this a internal or external form.  If external, can you paste it here?  Remove any sensitive info of course.

Here's a snippet for a single field and what is required for a external form.  All the below is in a single .php file, but pruned to just show the minimum fields.

Registration Page

PHP Code:
<?php
require_once("/xxx/xxx/formtool/global/api/api.php");
$fields ft_api_init_form_page(2);

// validation time!
$errors = array();
if (isset(
$_POST['sbmt']))
 
    {
 
   $rules = array();
 
    $rules[] = "required,firstname,Please enter your first name.";
 
    $rules[] = "letters_only,firstname,Please only use letters for your first name. *-No spaces/numbers/etc.";
 
    $errors validate_fields($_POST$rules);
 
   
// no errors - great! Now we process the page. The ft_api_process_form does
// the job of both updating the database and redirecting to the next page
 
   if (empty($errors))
 
        {
 
       $params = array(
 
           "submit_button" => "sbmt",
 
            "next_page" => "https://www.xxxx.com/wp/thank-you/",
 
            "form_data" => $_POST,
 
            "finalize" => true
            
);
 
        ft_api_process_form($params);
 
        
// it failed validation. Update $fields with the latest contents of the form data
 
   else
         
{
 
       $fields array_merge($_SESSION["form_tools_form"], $_POST);
 
        
 
   
?>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
<head>
<title>Registration Form</title>
<link rel="stylesheet" type="text/css" href="registration.css">
</head>
<body>

<?php
// if $errors is not empty, the form must have failed one or more validation
// tests. Loop through each and display them on the page for the user
if (!empty($errors))
 
    {
 
   echo "<div class='error'>Please fix the following errors:\n<ul>";
 
    foreach ($errors as $error)
 
    echo "<li>$error</li>\n";
 
    echo "</ul></div>";
 
   
?>

<!-- Start of FORM -->
<div align="center">
<form action="<?php echo $_SERVER["PHP_SELF"]?>" method="POST">
  <table border="1" cellpadding="5" cellspacing="1" width="800">
    <tbody>
      <tr align="center">
        <td colspan="2" rowspan="1" valign="top"> <h2>HEADER 2</h2></td>
      </tr>
      <tr align="center">
        <td rowspan="1" colspan="2" valign="top" width="618"><BIG><BIG><B>TITLE<br>
        </td>
      </tr>
      <tr>
        <td align="right" valign="top" width="35%">First Name<br>
        </td>
        <td valign="top" width="618"><input maxlength="30" size="30" type="text" name="firstname" value="<?=@$fields["firstname"]?>" /> *-Required</td>
      </tr>
      <tr>
        <td colspan="2" rowspan="1" valign="top">
        <div align="center">Please confirm everything is correct before you submit!<br><input name="sbmt" value="Submit/Validate Form" type="submit"> </div>
        </td>
      </tr>
    </tbody>
  </table>
</form>
</div>
<!-- End of FORM -->
</body>
</html> 


You'll have to read through the options for the different field types, but the above should give you a base page to start with.  Hopefully, I didn't bork anything up by removing too much for this example.

Lyle