0

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){
                    $.post("updateStatus.php",
                    { status: "sys_status", system: "my_system" }, function(data){alert("Data Loaded: " + sys_status); });  
                }
            </script>    


             <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" />
            </form>

Edited by Dani: Fixed formatting

2
Contributors
2
Replies
5
Views
5 Years
Discussion Span
Last Post by monkeybut
0

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.