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

  • Home
  • SEARCH
  • 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 3961670
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T03:00:10+00:00 2026-05-20T03:00:10+00:00

I have a few hidden form elements like so: <input type=hidden name=numberOfAdults /> I

  • 0

I have a few hidden form elements like so:

<input type="hidden" name="numberOfAdults" />

I then have an onsubmit function that does some addition and puts the sum into the hidden fields:

form.numberOfAdults.value = numAdults;

The form is submitted depending on if this function returns true or false. When the form is submitted, IE7+ and Firefox show the changed value from the onsubmit function. Safari and Chrome do not. However, if I give the hidden inputs default values:

    <input type="hidden" name="numberOfAdults" value="2" />

Then the value gets passed. Why are Safari and Chrome ignoring these changed values?

EDIT: Here is the complete code: http://jsfiddle.net/2q8SX/

  • 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-20T03:00:11+00:00Added an answer on May 20, 2026 at 3:00 am

    just a wild guess:

    give your submit button:

    onclick="yourFunction(); return false;"
    

    and add to your function() as it’s last command:

    document.getElementByTagName('form').submit();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is my html: <form> <dl> <dt>&nbsp;</dt> <dd><input type=hidden></dd> <dt>Dont hide this one</dt> <dd><input
I have a Form class that contains many fields. I would like to render
I have a simple form with two hidden inputs that is causing extra white
I have a form with a few input fields spread throughout the markup. What
I've got a simple form like so (illustrative purposes only)... <form> <div class=input-row> <label>Name</label>
i have few div's in my form which needs to be hidden at first
I have few form fields, each input and label is wrapped inside a div
I have a table that looks like the following. <tr> <td>Link Name</td> <td><a href=#
I have few controls (Label, Custom Textbox, Datagridview) docked on a form. When I
I have few text fields like SSN , phone number and email id. I

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.