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 7654727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T12:19:50+00:00 2026-05-31T12:19:50+00:00

I have this form inside a table: <table id=fields> <form method=post id=accountform></form> <tbody><tr><td class=key>First

  • 0

I have this form inside a table:

<table id="fields">
    <form method="post" id="accountform"></form>
    <tbody><tr><td class="key">First Name:</td><td class="value">bla bla</td></tr>
    <tr><td class="key">Last Name:</td><td class="value">bla bla</td></tr>
    <tr><td class="key">Email:</td><td class="editable"><input type="text" class="textbox" value="blabla" name="input0"></td></tr>
    <tr><td class="key">Cell Number:</td><td class="editable"><input type="text" class="textbox" value="123-456-7890" name="input1"></td></tr>
    <tr><td class="key">Extension:</td><td class="editable"><input type="text" class="textbox" value="1234" name="input2"></td></tr>
    <tr><td class="key">Authority Level:</td><td class="value">Admin</td></tr>
    <tr><td align="right" colspan="2"><input type="submit" value="Save" id="submit"></td></tr>
</tbody></table>

Javascript/jQuery:

$(document).ready(function(){
    $("form#accountform").submit(function() {
        alert($(this).serialize());
    });
});

When I submit the form the alert comes out blank. 😐
I really have NO idea why this happens. Each text box has a name. I’ve serialized forms similar to this (inside a table) before.

Edit:
This is the ‘original’ HTML (before the jQuery and browser edits it):

<table id="fields">
    <form method="post" id="accountform" action="">
    <tr><td class="key">First Name:</td><td class="value"><?php echo $_SESSION['firstname']; ?></td></tr>
    <tr><td class="key">Last Name:</td><td class="value"><?php echo $_SESSION['lastname']; ?></td></tr>
    <tr><td class="key">Email:</td><td class="editable"><?php echo $_SESSION['email']; ?></td></tr>
    <tr><td class="key">Cell Number:</td><td class="editable"><?php echo formatPhone($_SESSION['phone']); ?></td></tr>
    <tr><td class="key">Extension:</td><td class="editable"><?php echo $_SESSION['ext']; ?></td></tr>
    <tr><td class="key">Authority Level:</td><td class="value"><?php echo authToName($_SESSION['auth']); ?></td></tr>
    <tr><td align="right" colspan="2"><input type="submit" value="Edit" id="submit"/></td></tr>
    </form>
</table>

And this is the jQuery that replaces the text with textboxes:

$("td.editable").each(function(index) {
                $(this).html("<input type='text' class='textbox' value='"+$(this).html()+"' name='input"+index+"'/>");
})
  • 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-05-31T12:19:52+00:00Added an answer on May 31, 2026 at 12:19 pm

    The problem is definitely the markup:

    <table id="fields">
        <form method="post" id="accountform" action=""> <!-- Form does not go in the table -->
        <tr>...</tr>
            ...
        <tr>...</tr>
        </form> <!-- Form does not go in the table -->
    </table>
    

    Wrap your table in the <form> tags instead of putting them in the table.

    <form method="post" id="accountform" action="">
        <table id="fields">
            <tr><td class="key">First Name:</td><td class="value"><?php echo $_SESSION['firstname']; ?></td></tr>
            <tr><td class="key">Last Name:</td><td class="value"><?php echo $_SESSION['lastname']; ?></td></tr>
            <tr><td class="key">Email:</td><td class="editable"><?php echo $_SESSION['email']; ?></td></tr>
            <tr><td class="key">Cell Number:</td><td class="editable"><?php echo formatPhone($_SESSION['phone']); ?></td></tr>
            <tr><td class="key">Extension:</td><td class="editable"><?php echo $_SESSION['ext']; ?></td></tr>
            <tr><td class="key">Authority Level:</td><td class="value"><?php echo authToName($_SESSION['auth']); ?></td></tr>
            <tr><td align="right" colspan="2"><input type="submit" value="Edit" id="submit"/></td></tr>
        </table>
    </form>
    

    Working fiddle (subbing in plain-text values for what your PHP code would sub in).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this form: <input type=checkbox value=First />First <input type=checkbox value=Second />Second <input type=checkbox
I have this form:- <form action=> <table border=0> <td colspan=2 class=instruction>Select your desired option
I have foreign key inside my Customer table. @JoinColumn(name = DISCOUNT_CODE, referencedColumnName = DISCOUNT_CODE)
I have form in my page, I am using ajax.beginform(). Inside this form I
I have this login form. This form is a grouped table view where the
I have this: <table id=myTable style=width: 650px;> <thead> <tr style=font-weight: bold;> <td>Name</td> <td>Price</td> <td>Supplier</td>
I have a raw form-data that look like this: ------------V2ymHFg03ehbqgZCaKO6jy Content-Disposition: form-data; name=intro O
I have this form: Markup is: <table style=width: 100%; padding:5px;> <col style=width: 20%; text-align:
I have a table inside a form. I'm trying to display a 'select' form
I have a table inside a form, which is populated with various input boxes.

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.