Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Feb 2005
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    checked functions??

    hi all...
    i'm having problem in writing codes to select a displayed data from database and then when clicking "Apply", user will be directed to an application form adn they are prompt to fill in the form. i have tried to write the function but it seems that the function did not recognize the variable, so it has not been able to execute. below here are some of my codes:

    foreach($row_descp3 as $field_descp3)
    {

    print("<tr>");
    print("<td><input type='checkbox' name='checkbox' value='checkbox'></td>");
    print("<td> $rloc3 </td> <td> $rtype3 </td> <td> $rdept3 </td> <td> $rlevel3 </td> <td> $field_descp3 </td>");
    print("</tr>");
    print "</tr>";

    }
    --------------------------------------------------------------------------
    and this is the function that i tried to write:

    <script language="javascript">

    function mychecked()
    {
    var value = false;

    if(document.search_php.checkbox.checked)
    {
    var my_checkbox =document.search_php.checkbox.value;

    value = true;
    document.location = "dynamicform.php";
    }

    if(!value)
    {
    window.alert('Please select one to view');
    return false;
    }

    }

    </script>
    -------------------------------------------------------------------------
    how do i invoke the checked box that i selected(the colored codes) and then make the function work? can anyone help me how to write the codes? need ur help very much...

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    you mean to validate? And, what are you going to do with the variable var my_checkbox?
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*


  •  

    Posting Permissions

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