Results 1 to 2 of 2

Thread: PHP-JAVASCRIPT multiple checkbox disabling textbox

Threaded View

  1. #1
    Join Date
    Apr 2011

    Wink PHP-JAVASCRIPT multiple checkbox disabling textbox


    can you please help me to achieve this?

    i have a multiple checkbox and multiple textbox.. and it is inside by mysql_fetch_array what i want to do is,, once i checked the checkbox it enable a textbox that i only want.

    PHP Code:
    <script language="javascript">

       function enableDisable()
    var checkBoxes = document.getElementsByName('MyCheckBox');
           // alert(checkBoxes.length);
                   var param = "";
                    for (var counter=0; counter < checkBoxes.length; counter++) {
                                    if (checkBoxes[counter].checked == true) {
                                                  param += checkBoxes[counter].value;
                                                //param +=document.MyForm.MyCheckBox[counter].value;


    <?php $ctr=0;
    $row=mysql_fetch_array($sql2)){  ?>
    <td><input type="checkbox" name="MyCheckBox" onclick="enableDisable();" value="<?php echo $ctr+=1?>">
    <input type="text" id="time_bound" name="time_bound[]" value="<?php echo $row['time_bound']; ?>" disabled="true">

    <?php }?>
    i did not actually add the other codes because its not that important i think
    Last edited by ballball; 03-27-2013 at 09:27 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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