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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:57:00+00:00 2026-05-29T07:57:00+00:00

Hi i want to get changed text value from JQuery but i can’t select

  • 0

Hi i want to get changed text value from JQuery but i can’t select edit text with JQUERY because edit texts generated from php while loop that this php code query on database and get value of edit texts and in my program i have edit button for every edit texts and when the user changed value of edit text i select new value and when user click edit button send this value from get method to another php page with jquery $.ajax function and send new value to that php code with ajax.But i don’t know how can i select edit text that it’s value changed because i don’t know id of that edit text!.And when i set one id for every edit text i only get first edit text value from $("#id").change().val();.I use below code but it doesn’t work.I am beginner in java script and don’t know how fix this problem!.

var testAnswer;

function setNewTestAnswer(id){
    testAnswer = $("#id").val();
}
function sendToEdit(pID,phID,thDate,type){
    var info = 'pId='+pID+'&phId='+phID+'&testAnswer='+testAnswer+'&thDate='+thDate+'&type='+type;
}

2nd function use testAnswer that user changed in edit text.
php code

<?php
    include 'Connect.php'; 
    if(match($_POST['pId'], "/^[\d]+$/") ){
        $pId = $_POST['pId'];
        $result = mysql_query("select pName, pID, phName, phID, testHistoryDate, type, testAnswer from patient join reception using(pID) join physician using(phID) join testHistory using(rID) join test using(tID) where pID = $pId",$connection);
    }
    else
        die("Insert true value");
    while($row=mysql_fetch_array($result)){
        echo "<tr><td>";
        echo $row["pName"].'</td>';
        echo '<td>'.$row["phName"].'</td>';
        echo '<td>'.$row["testHistoryDate"].'</td>';
        echo '<td>'.$row["type"].'</td>';
        $type =  $row['type'];
        $testHistoryDate = $row['testHistoryDate'];
        ?>
        <td>
            <span id='spryTanswer'>
                <input type='text' name='tAnswer' id='tAnswer' value='<?php echo $row['testAnswer']; ?>' />
            </span>
        </td>
        <td>
            <input type='submit' value='Edit' name='edit' id='edit' onclick="sendToEdit('<?php echo $row['pID'] ?>','<?php echo $row['phID'] ?>', '<?php echo $row['testHistoryDate'] ?>', '<?php echo $row['type'] ?>')" />
        </td>
        </tr>
    <?php } ?>
  • 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-29T07:57:00+00:00Added an answer on May 29, 2026 at 7:57 am

    Since you’re creating elements inside a php loop, you must be sure that every element has a unique id (or no id at all). You can use either an incrementing index, or some unique value in your array. At first glance, seems that $row['pID'] is a good candidate:

    <input id='edit_<?php $row['pID'] ?>' type='submit' value='Edit' ... />
    

    After that you should be able to target individual elements.

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

Sidebar

Related Questions

I have a simple dropdown box and jquery to get value from what i
I have a check box and want to get the very inital value or
I want to change the text value in the search box to say, for
I create select element dynamically using jquery, and I want to make action when
I'm trying to get a changed currentcell event in DataGridView , but every time
I want to get the ID of an element which is <input type=text id='4711_herstellerName'
I want to use JavaScript to make a simple http get. I used jQuery
I have a text log from a game with (for example) two types of
Edit: I've changed my question and code to clarify my question better I've got
I'm struggling with the following problem. I use the jQuery autocomplete plugin to get

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.