MasterACE14 Posted November 2, 2007 Share Posted November 2, 2007 Morning Everyone, I have a function which is suppose to disable a form once the submit button has been clicked once. But it isn't working. here is the script, and an example form: <script language="JavaScript"> function Disab (val,formname) { if(val=="1") {formname.Submit.disabled=true} if(val=="2") {formname.Button.disabled=true} } </script> <form name="strikeops" method="post" action="index.php?page=ability_result"> <input type="hidden" name="strikeopsprice" value="<?=$player_strikeops_price?>"> <input type="hidden" name="strikeopsamount" value="<?=$player_strikeops_amount?>"> <input type="submit" name="buy" value="Train" onClick="Disab (1,strikeops)"> </form> Regards ACE Quote Link to comment Share on other sites More sharing options...
lighton Posted November 3, 2007 Share Posted November 3, 2007 I didnt even know you could do that anyhoo here are some obvious suggestions to why it might not be working You havent fetched the form object in the script add an id="strikeops" to the form then in the javascript function add var formObj = document.getElementById("strikeops"); and also it should be formObj.submit and not formObj.Submit as javascript is case sensitive hope this helps Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.