The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/showthread.php 26 require_once
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/showthread.php 26 require_once
Warning [2] Undefined variable $newpmmsg - Line: 40 - File: global.php(841) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/global.php(841) : eval()'d code 40 errorHandler->error
/global.php 841 eval
/showthread.php 26 require_once
Warning [2] Undefined array key "style" - Line: 909 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 909 errorHandler->error
/showthread.php 26 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5024 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 5024 errorHandler->error
/global.php 909 build_theme_select
/showthread.php 26 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions.php 5044 is_member
/global.php 909 build_theme_select
/showthread.php 26 require_once
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1380 fetch_forum_permissions
/inc/functions.php 2909 forum_permissions
/showthread.php 621 build_forum_jump
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1380 fetch_forum_permissions
/inc/functions.php 2909 forum_permissions
/showthread.php 621 build_forum_jump
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1380 fetch_forum_permissions
/inc/functions.php 2909 forum_permissions
/showthread.php 621 build_forum_jump
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1380 fetch_forum_permissions
/inc/functions.php 2909 forum_permissions
/showthread.php 621 build_forum_jump
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1380 fetch_forum_permissions
/inc/functions.php 2909 forum_permissions
/showthread.php 621 build_forum_jump
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1380 fetch_forum_permissions
/inc/functions.php 2909 forum_permissions
/showthread.php 621 build_forum_jump
Warning [2] Undefined array key "mybb" - Line: 1952 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1952 errorHandler->error
/inc/functions_indicators.php 41 my_set_array_cookie
/showthread.php 629 mark_thread_read
Warning [2] Undefined property: MyLanguage::$ratings_update_error - Line: 5 - File: showthread.php(732) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/showthread.php(732) : eval()'d code 5 errorHandler->error
/showthread.php 732 eval
Warning [2] Undefined variable $postsdone - Line: 867 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 867 errorHandler->error
Warning [2] Trying to access array offset on value of type null - Line: 867 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 867 errorHandler->error
Warning [2] Undefined array key 29813 - Line: 867 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 867 errorHandler->error
Warning [2] Undefined array key 32091 - Line: 867 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 867 errorHandler->error
Warning [2] Undefined array key 35386 - Line: 867 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 867 errorHandler->error
Warning [2] Undefined array key 37396 - Line: 867 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 867 errorHandler->error
Warning [2] Undefined array key 29813 - Line: 1576 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 1576 errorHandler->error
/showthread.php 1578 buildtree
/showthread.php 879 buildtree
Warning [2] Undefined array key 37396 - Line: 1576 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 1576 errorHandler->error
/showthread.php 1578 buildtree
/showthread.php 1578 buildtree
/showthread.php 879 buildtree
Warning [2] Undefined array key 35386 - Line: 1576 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 1576 errorHandler->error
/showthread.php 1578 buildtree
/showthread.php 879 buildtree
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions_user.php 844 is_member
/inc/functions_post.php 406 purgespammer_show
/showthread.php 880 build_postbit
Warning [2] Undefined array key "profilefield" - Line: 6 - File: inc/functions_post.php(474) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/inc/functions_post.php(474) : eval()'d code 6 errorHandler->error
/inc/functions_post.php 474 eval
/showthread.php 880 build_postbit
Warning [2] Undefined array key "canonlyreplyownthreads" - Line: 660 - File: inc/functions_post.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions_post.php 660 errorHandler->error
/showthread.php 880 build_postbit
Warning [2] Undefined array key "showimages" - Line: 741 - File: inc/functions_post.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions_post.php 741 errorHandler->error
/showthread.php 880 build_postbit
Warning [2] Undefined array key "showvideos" - Line: 746 - File: inc/functions_post.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions_post.php 746 errorHandler->error
/showthread.php 880 build_postbit
Warning [2] Undefined array key "invisible" - Line: 1506 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 1506 errorHandler->error
Warning [2] Undefined variable $threadnotesbox - Line: 30 - File: showthread.php(1533) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/showthread.php(1533) : eval()'d code 30 errorHandler->error
/showthread.php 1533 eval
Warning [2] Undefined variable $multipage - Line: 33 - File: showthread.php(1533) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/showthread.php(1533) : eval()'d code 33 errorHandler->error
/showthread.php 1533 eval
Warning [2] Undefined variable $multipage - Line: 65 - File: showthread.php(1533) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/showthread.php(1533) : eval()'d code 65 errorHandler->error
/showthread.php 1533 eval
Warning [2] Undefined variable $addremovesubscription - Line: 79 - File: showthread.php(1533) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/showthread.php(1533) : eval()'d code 79 errorHandler->error
/showthread.php 1533 eval



FORUMS


The Form Tools forums are no longer active, but the old posts have been archived here. Please see the Help page on how to get help / report issues.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Validation help for a NooB (JS?)
#5
(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
Reply


Messages In This Thread
Validation help for a NooB (JS?) - by eris667 - Feb 25th, 2017, 12:13 PM
RE: Validation help for a NooB (JS?) - by eris667 - Mar 4th, 2017, 8:06 PM
RE: Validation help for a NooB (JS?) - by eris667 - May 1st, 2017, 1:02 PM
RE: Validation help for a NooB (JS?) - by ocbroadband - Nov 2nd, 2017, 6:47 PM
RE: Validation help for a NooB (JS?) - by nelsondcosta - Aug 23rd, 2017, 7:19 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)