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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:30:41+00:00 2026-05-26T21:30:41+00:00

I am stuck with this.. and I am new also so not really promising.

  • 0

I am stuck with this.. and I am new also so not really promising. I have a html table that is being populated using php and mysql. Each row has 4 columns, one of the columns is a ‘update’ button with the follwoing syntax

print("<input type='submit' value='Update' name='update' class='submit_button'/>");

now, the class=’submit_button’ is new as i added per a suggestion in a related question using json and the function is here

$( '.submit_button' ).click( function(){

        var value = {};

        $( this ).closest( '.submit_button' ).find( 'input, select' ).each(function(){  
            value[ $(this).attr('name') ] = $(this).val();
        });

        $.post( "test.php", 
            value,
            function(data){
                //success
                alert( data );
            }, 
            "json"
        );

    });

I was expecting to see the alert saying it posted or something… but nothing… Now I also tried adding a form to the row.. but that did not work either. Here is my full html table

print("<table id='results'><tr><th>ID</th><th>Image</th><th>Name</th><th>Price</th><th>Price Label</th><th>Description</th><th>Update</th></tr>");

     while($row2 = mysql_fetch_array( $result2 )){ 
         $client_id = $row2["client_id"];
         $client_name = $row2["client_name"];
         $client_disc = $row2["client_disc"];
         $client_price = $row2["client_price"];
         $client_image = $row2["client_image"];
         $client_price_label = $row2["client_price_label"];

         print("<tr>");   
         print("<td>");
         print("<p style='font-size:14px; color:blue; padding:0;'>$client_id</p>");
         print("</td>");          
         print("<td>");
         print("<img class='custom_rate' alt='' src='$client_image' />");
         print("</td>");
         print("<td width='100px'>");
         print("<input type='text' value='$client_name' name='clientname'/>");
         print("</td>");
         print("<td>");
         print("<input type='text' value='$client_price' name='clientprice'/>");
         print("</td>");
         print("<td width='100px'>");
         print("<input type='text' value='$client_price_label' name='clientpricelabel'/>");
         print("</td>");
         print("<td width='100px'>");
         print("<textarea cols='15' rows='2' name='description'>$client_desc</textarea>");
         print("</td>");
         print("<td width='100px'>");
         print("<input type='submit' value='Update' name='update'/>");
         print("</td>");
         print("</tr>");
    }

    print("</table>");

So i am not sure how to make this work, if you could help me elaborate on the json way.. or if there is another way… I was thinking maybe something simpler.. How can I just click on the update button and get the values and store them somewhere in the same page where i can use them, and then i will pass those values to php variables and do my update?

Thank you for the patience

  • 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-26T21:30:42+00:00Added an answer on May 26, 2026 at 9:30 pm

    It’s a submit button so it is submitting your page before the Javascript has a chance to run.

    Try a regular type=”button” and see if that works.

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

Sidebar

Related Questions

Being new to the Entity Framework, I'm really rather stuck on how to proceed
I'm really stuck with this. To show my problem I created a new Django
I have been stuck on this for a while now and I cannot seem
I'm a wee bit stuck on this, and was hoping you might have some
I'm really stuck. I've used cron on many machines, but I simply can not
I have inherited some code that is not working as I think it should:
This is not really a technical programming question, but has more to do with
I've come a bit stuck this afternoon with a bug in my web application
Been stuck on this for ages. Currently learning Django and done some bits on
Im stuck with this little project in C# but basically my problem is this:

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.