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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:57:12+00:00 2026-05-26T22:57:12+00:00

I am producing multiple forms from my php code as shown below. The problem

  • 0

I am producing multiple forms from my php code as shown below.

The problem is that, If I want to perform a jquery-ajax request, How can I refer to a form. My goal is that when the submit button is clicked, the relevant data from that form should be posted.

Previously, I was referring to form with its $('#id').submit() function. But I am stuck here since all of the forms have the same name.

<form id="view-doc" method="post" target="report" action="../classes/openDoc.php">
<input type="hidden" id="id" name="id" value="1"/>
<input type="hidden" id="filename" name="filename" value="Research Writer Test 8.doc" />
<input type="hidden" id="filetype" name="filetype" value="doc" />
<td><input type="submit" class="s-button btn_normal" id="submit" value="View" onsubmit="window.open(about:blank,report,width=300,height=200)" />
</form>

<form id="view-doc" method="post" target="report" action="../classes/openDoc.php">
<input type="hidden" id="id" name="id" value="2"/>
<input type="hidden" id="filename" name="filename" value="template[1].IEEEdoc.doc" />
<input type="hidden" id="filetype" name="filetype" value="doc" />
<input type="submit" class="s-button btn_normal" id="submit" value="View" onsubmit="window.open(about:blank,report,width=300,height=200)" />
</form>

<form id="view-doc" method="post" target="report" action="../classes/openDoc.php">
<input type="hidden" id="id" name="id" value="3"/>
<input type="hidden" id="filename" name="filename" value="Assignment #3.docx" />
<input type="hidden" id="filetype" name="filetype" value="ocx" />
<input type="submit" class="s-button btn_normal" id="submit" value="View" onsubmit="window.open(about:blank,report,width=300,height=200)" />
</form>
  • 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-26T22:57:13+00:00Added an answer on May 26, 2026 at 10:57 pm

    id attribute has to be unique. If possible please consider view-doc-1, view-doc-2 and view-doc-3 for the forms’ id.

    Otherwise, use class instead of id and do this on JavaScript:

    $(".view-doc input[type=submit]".bind('click', function() {
       // your code when button clicked. fired on all the 3 buttons
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This simple code is not producing any sound on a couple of machines that
$string = php, photoshop, css; I'm producing an array from the comma separated values
The below code is producing the wrong result. On the work sheet we are
I'm new to javascript, my problem is effectively: I have a php page that
I'm writing an audio application that has multiple threads producing sound and one thread
We are producing a portable code (win+macOs) and we are looking at how to
I'm producing a hex file to run on an ARM processor which I want
I'm producing XML right from PL/SQL in Oracle. What is the preferred way of
My LINQ query is not producing the expected output below. Basically, it's the sum
My software uses multiple threads to do its work. There is a pipeline that

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.