SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jul 2010
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Enable/Disable Text Boxes

    Hi JS Gurus,

    I'm really stucked with below logic. Please help.
    I need to enable(disabled="false") the text box mode when user click on edit button. this is my code;

    Code PHP:
    while ($rw = mysql_fetch_array($query1)) {
    $k = $rw['Record_id'];
    echo '<tr>';
    echo'<form name = "t_data">';
    echo '<td>'.'<input type="text" name="Record_id" value="'.$rw['Record_id'].'" disabled="true" size = "5"/>'.'</td>';
    echo '<td>'.'<input type="text" name="file_number" value="'.$rw['file_number'].'" disabled="true" size = "9"/>'.'</td>';
    echo'</form>';
     
    echo' <td>';
    echo'<form action="edit_grid.php" method = "GET">';
    echo'<input type="submit" id="'.$k.'" value="Edit" onclick = "m()">';
    echo'<input type="hidden" name="hf" value="'.$k.'">';
    echo'</td>';

    How do I achieve this..Please help..

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,870
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Code:
    function m() {
    t_data.file_number.disabled="false";
    return false;
    }
    Presumably you have some code elsewhere that will copy the content from the t_data form and send it back to the server since that form currently has no way to be submitted from the code you have shown.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •