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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:35:21+00:00 2026-06-14T22:35:21+00:00

I need to make a table with clickable rows (for this I found some

  • 0

I need to make a table with clickable rows (for this I found some Javascript solutions).
When I click one row, a form will be filled with data from the clicked row.

But I don’t know how to send the data from HTML table to PHP, when I click on that row. Data must be sent as POST, as I mentioned in title.

I have no idea how to start, so I cannot show you nothing. Using multiple forms inside one table is not allowed, <a> tag around <td> is not allowed either, so I’m stuck.
From what I searched on web, the solution would be AJAX, but I’m not familiarized with it, never used AJAX, so if possible, a non-AJAX solution would be much appreciated. If not, please show me a functional example.

EDIT solved

In the end I did it without any AJAX, thanks to ideas from emartel and Guerra.
I made a single form with a hidden input field and I submitted it programatically, after I collected the required data from the row I clicked on.

I echoed the tr tags like this: <tr data-id=$id_from_db onclick="submit_id(this)">.


    function submit_id(tableRow) {
        //get ID
        var myID = tableRow.dataset.id;

        //set ID
        var setID       = document.getElementById('order_id');
            setID.value = myID;

        //submit
        var form = document.getElementById('myform');
        form.submit();
    };

P.S. I tried to embed some PHP code, but I failed, it didn’t shown on page.

  • 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-06-14T22:35:22+00:00Added an answer on June 14, 2026 at 10:35 pm

    After filling your form (name="myform" and method="post") from JavaScript, simply call:

    document.myform.submit();
    

    This should do the work

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

Sidebar

Related Questions

I need to copy a row based on some condition(where clause), from a table,make
I currently have a java script solution to make an entire table row clickable.
I have a script which can make each table row clickable (as a link),
I need to make some installation action (create a table record) after python manage.py
I just need to make a SQL table of time zones - at this
I need to make every two rows of my table grey and I would
I need to make a copy of a row in a table and also
I'm trying to make a table row highlight when I click a certain link.
I am making a multi-table fulltext query.But I met some question. I need make
I need to make table with number of rows equals to number of days

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.