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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:08:47+00:00 2026-05-27T08:08:47+00:00

Have a form <div class=customer> <input type=text name=customer /> <input type=text name=address /> <select

  • 0

Have a form

<div class="customer">

<input type="text" name="customer" />
<input type="text" name="address" />
<select name="married">
  <option value="0">No</option>
  <option value="1">Yes</option>
</select>

</div>

Using jQuery, users can add as many customers as they like to the form. How do I keep each customer separated for validation and database purposes? I believe using an array field is the answer but I am concerned about empty values such as missing an address or failing to answer the “married” question.

Thanks.

  • 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-27T08:08:48+00:00Added an answer on May 27, 2026 at 8:08 am

    You will have to append a [] to all your fields, so in your case it will look like this:

    <div class="customer">
       <input type="text" name="customer[]" />
       <input type="text" name="address[]" />
       <select name="married[]">
         <option value="0">No</option>
         <option value="1">Yes</option>
       </select>
     </div>
    

    Then using a server side language like php you can parse the data like:

    $customer = $_REQUEST['customer']; // array holding all customer fields
    $address = $_REQUEST['address'];  // array holding all address fields
    $married = $_REQUEST['married']; // array holding all married fields
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form.html: <div id=tag_option> <li><label for=id_customer_type>Customer type:</label> <select id=id_customer_type class=required name=customer_type> <option
I have a simple form: <div class=class_a> <fieldset> <label><input type=radio id=radio10 name=color value=1 />Red</label><br
I have radioboxes <form method=post id=myform> <label>A</label> <input type=radio name=formtype value = 1 checked=checked>
I have a form element defined as: <div class=field> <div class=name> <label for=User_LastName> Last
I have a form that looks kind of like this: <div> <div class=contact> <h1>Person's
I have the following code (inherited from someone): <div class=feedback>&nbsp;</div> <form onsubmit=return false autocomplete=off>
I have simple form: <form action=add.php method=post > <input name=name maxlength=30/><br/> <textarea cols=80 name=description
I have the following form in cakephp: <div class=quickcontactDisplay> <?php echo $form->create('Enquiry',array('action'=>'add','class'=>'quickcontact')); echo $form->hidden('visitor_id',
On my Drupal website I've got something like this: <div class=form-item form-type-textfield item-1> <div
I have a code something like this: <div class=clearfix> <%= label_tag 'customer_email', 'Customer Email'

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.