Forum Moderators: open
<input type="checkbox" name="highmark" onclick="loadFile('highmark.php')" >
Right now whenever the user checks or unchecks the box, the "highmark.php" file runs. However I want to run the "highmark.php" file only when the user checks the box. If the user unchecks the box I don't want to do anything.
I know the logic I need, where I call this function multiple times I need to pass in the script name and the checkbox name e.g. function loadFile(targetFile, checkBoxName). Then if the checkBox has been checked I want to run my code. Otherwise I don't want to do anything. I am not a JavaScript programmer so I don't know the syntax. Any help? Thanks,