I am trying to get a query to run to update the status of the system whenever the radio button is selected without having to use submit buttons, but for some reason I cannot get it to work right, here is what I have so far but it isn't working, I need someone to push me in the right direction on this, thanks

 <script language="javascript">
                function update(sys_status, my_system){
                    { status: "sys_status", system: "my_system" }, function(data){alert("Data Loaded: " + sys_status); });  

             <li style='line-height: 150%'> <form method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>" id="status">
                <label title="Set Status" for="setStatus" accesskey="p">Set Status: </label>

                <input type="radio" name="status" id="status"  value="w" onclick="update('w', <?php echo $strHW_Asset;?>)"/>In Use&nbsp;
                <input type="radio" name="status" id="status"  value="i" onclick="update('i', <?php echo $strHW_Asset;?>)"/>Inactive&nbsp;
                <input type="radio" name="status" id="status"  value="n" onclick="update('n', <?php echo $strHW_Asset;?>)"/>Destroyed
                <input type="hidden" name="statusID" value="true" />

Edited by Dani: Fixed formatting

5 Years
Discussion Span
Last Post by monkeybut

Yes I have jquery included in the main include file to ensure it is available in every page.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.