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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:17:59+00:00 2026-05-24T09:17:59+00:00

I have 2 forms <form name= form1 action=> <input type=hidden name=max id= max1 value=100/>

  • 0

I have 2 forms

<form name= "form1" action="">
  <input type="hidden" name="max" id= "max1" value="100"/> 
  <input type="submit"  class="submit" value="part 1" />
</form>

<form name= "form2" action="">
  <input type="hidden" name="max2" id= "max2" value="200"/> 
  <input type="submit"  class="submit" value="part 2" />
</form>

I get the values from this form here

         $(".submit").click(function () {

 here  -->       var max_res = $("input#max1").val();
                 var  Results = "Max Result " + max_res;      
         });

My question is how can i dynamically change the id from max1 to max2 so I can store max2‘s value in max-res when a click is made in form2

  • 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-24T09:18:00+00:00Added an answer on May 24, 2026 at 9:18 am
     var max_res = $('input[id^="max"]', $(this).parent()).val();
     //selects the id starting with max in this form
     var  Results = "Max Result " + max_res; 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have multiple forms like so: <form method=post action=change.php id=form1> <input name=product_id type=hidden value=abc
hey, well I have this form <form method=POST action=''> <input type=hidden name=op value=download1> <input
I have a form: <form style=display: inline; action=/player.php method=post> <input type=hidden name=recname value='.$row['name'].'> <input
Assume I have a form class SampleClass(forms.Form): name = forms.CharField(max_length=30) age = forms.IntegerField() django_hacker
I have a form with two text_fields: <input type=text id=post_name name=post[name] /> <input type=text
Say I have this simple form: class ContactForm(forms.Form): first_name = forms.CharField(required=True) last_name = forms.CharField(required=True)
I have a form in HTML with multiple inputs of type submit: <form id
I have some question. I have the html form with one hidden input element.
I have a form to upload image like below <form name=sample enctype=multipart/form-data action=index.php method=post
I have a form with the following HTML below: <form id=course_edit_form name=course_form action=/courses/save method=post>

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.