Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9046857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T11:45:30+00:00 2026-06-16T11:45:30+00:00

Can someone give me a hand with this please? I have been using jquery-validate

  • 0

Can someone give me a hand with this please? I have been using jquery-validate without issues for html forms until I came across an issue with HTML forms embedded in php.

The example below is using jquery and jquery-validate.
Form1 is validating the email field fine. Form3 however is not validating the number field (form3 is embedded in php).

I have attempted to comment out all form1 validation to ensure it wasn’t multiple forms causing the issue.

I also tried commenting out the submitHandler from the javascript for form3 and this prevented form3 from submitting so this tells me that something is working it’s just not validating the number field in form3.

<script>
$(document).ready(function() {
    $("#form1").validate( {
        errorPlacement: function(error, element) {
            error.appendTo( element.parent("span").next("div") );
        },

        debug:true,
        wrapper: "li", 
        submitHandler: function(){
            form.submit();
        },
        rules: {                
            email: {required:false, email:true},
        },

        messages: {
            email: "Enter a valid email address",
        }
    })

    $("#form3").validate( {
        errorPlacement: function(error, element) {
            error.appendTo( element.parent("span").next("div") );
        },

        debug:true,
        wrapper: "li", 
        submitHandler: function(){
            form3.submit();
        },

        rules: {                
            quotaLimit: {required:true, number:true},
        },

        messages: {
            quotaLimit: "Enter a valid quota limit",
        }
    })
});
</script>

<br>

<div class="tab-button-row" style="position:relative;">
<a href="#" class="tab-button" onclick="toggleTab('editUserContent', 'details');">User Details</a>
<a href="#" class="tab-button" onclick="toggleTab('editUserContent','quotas');">Quota and Limits</a>
</div>
<br>

<div id="editUserContent">
<div id="details">
    <form id=form1 method=POST
          action="index.php?function=edituser&command=save&username=<?php echo $user->{"username"}; ?>"
          name=form>

        <?php
        if ($user->{'authenticationType'} == 0) {
            $visible = "";
        } else {
            $visible = "style='display:none;'";
        }
        ?>

        <table class="list">
            <tr>
                <td colspan=5><b>Edit Details</td>
                </td>
                <td width=25%><input type=submit value=save></td>
            </tr>

            <tr>
                <td>First Name:</td>
                <td>
                    <input name="fname" value="<?php echo $user->{"fname"};?>">
                </td>
                <td>Last Name:</td>
                <td>
                    <input name="lname" value="<?php echo $user->{"lname"};?>">
                </td>
                <td>Email:</td>
                <td>
                    <span>
                    <input name="email" value="<?php echo $user->{"email"};?>" class='validate'>
                    </span>
                <div></div>
                </td>
            </tr>
        </table>

        <br>
        <table class="list" <?php echo $visible; ?>>
            <tr>
                <td colspan=5><b>Password Settings</td>
                </td>
                <td width=25%><input type=submit value=save></td>
            </tr>
            <tr>
                <td>Set Password</td>
                <td><input type=checkbox name=change_password></td>
                <td>New Password:</td>
                <td><input name="password" type=password></td>
                <td>Re-enter Password:</td>
                <td><input name="re_password" type=password></td>
            </tr>
        </table>
    </form>
</div>

<div id="quotas">
    <?php
    $table = new Table();
    $name = new Column("Quota Period");
    $name->render = function($data, $id)
    {
        echo $data->{'period'};
    };

    $desc = new Column("Quota Limit(MB)");
    $desc->render = function($data, $id)
    {
        echo $data->{'quotaLimit'};
    };

    $owner = new Column("Group Owner");
    $owner->render = function($data, $id)
    {
        if (isset($data->{'owner'})) {
            echo "<a href=index.php?function=editgroup&group=" . $data->{'ownerid'} . ">" . $data->{'owner'} . "</a>";
        }
    };

    $reached = new Column("Quota Reached");
    $reached->render = function($data, $id)
    {
        if ($data->{'exceeded'} == true) {
            echo "true";
        } else {
            echo "false";
        }
    };

    $ops = new Column("Operations");
    $ops->render = function($data, $id)
    {
        if (!isset($quotas[$i]->{'owner'})) {
            echo "<a href=index.php?function=edituser&command=deletequota&username=" . $_GET['username'] . "&period=";
            echo $data->{'period'} . "&quotaLimit=" . $data->{'quotaLimit'} . ">delete</a>";
        }
    };

    $table->addColumn($name);
    $table->addColumn($desc);
    $table->addColumn($owner);
    $table->addColumn($reached);
    $table->addColumn($ops);
    $table->setData($quotas);
    $table->footerMethod = function($footerArgs)
    {
        echo" <form id=form3 method=POST action=index.php?function=edituser&command=addquota&username=" . $_GET['username'] . ">";
        echo "<tr><td>";
        echo "<select name='period'>";
        echo "<option>NONE</option>";
        echo "<option>DAY</option>";
        echo "<option>WEEK</option>";
        echo "<option>MONTH</option>";
        echo "</select>";
        echo "</td>";

        echo "<td>";
        echo "<span><input name=quotaLimit class='validate' /></span><div></div>";
        echo "</td>";

        echo "<td></td>";
        echo "<td></td>";
        echo "<td><input type=submit value='Add/Set'></td></tr>";
        echo "</form>";
    };

    $table->render();
    ?>

</div>
</div>

<script type="text/javascript">
initToggleTab("editUserContent", "details");
</script>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T11:45:31+00:00Added an answer on June 16, 2026 at 11:45 am

    Thanks for the help. Managed to fix the issue by moving the form tags outside of the table to where it is rendered by php:

        $table->footerMethod = function($footerArgs)
        {
            echo "<tr><td>";
            echo "<select name='period'>";
            echo "<option>NONE</option>";
            echo "<option>DAY</option>";
            echo "<option>WEEK</option>";
            echo "<option>MONTH</option>";
            echo "</select>";
            echo "</td>";
    
            echo "<td>";
            echo "<span><input name=\"quotaLimit\" class=\"validate\" type='text' /></span><div></div>";
            echo "</td>";
    
            echo "<td></td>";
            echo "<td></td>";
            echo "<td><input type=submit value='Add/Set'></td></tr>";
        };
    
        echo" <form id=form3 method=POST action=index.php?function=edituser&command=addquota&username=" . $_GET['username'] . ">";
        $table->render();
        echo "</form>";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I hope someone can give me a hand figuring this out. I have been
Can someone please give me a hand with this image downloading code? I want
Hoping someone can give me a hand here.... I have the DataTables jquery plugin
Can someone give me some advice on this? I am reading in an old
i have this html code. Im using Simple HTML Dom to parse the data
I have been stuck on this problem for quite awhile... I hope someone out
I don't obviously expect someone to write this for me, but can someone give
I wonder if someone give me a solution to this. How can I get
Here's hoping someone can give me a hand will a small JavaScript issue I'm
Can someone please give me an example of how public and private headers work?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.