mrnoisy

msg:1494328 | 3:45 am on Jun 8, 2003 (gmt 0) |
What about this: <script language="JavaScript" type="text/JavaScript"> function notyet() { alert("This function is not yet available!"); } </script> <form onsubmit="JAVASCRIPT:notyet()"> <input type="submit" value="Log on"> </form>
|
dreamcatcher

msg:1494329 | 8:00 am on Jun 8, 2003 (gmt 0) |
Cheers mrnoisy, I figured it would be something simple. I don`t really know Javascript that well. Thanks again. :)
|
BlobFisk

msg:1494330 | 10:07 am on Jun 9, 2003 (gmt 0) |
You don't need to include javascript: in the onClick method, it is assumed. Using onSubmit="myFunction()" will do just fine.
|
RonPK

msg:1494331 | 10:12 am on Jun 9, 2003 (gmt 0) |
Don't forget to include 'return false', otherwise the form will be submitted anyway. <form onsubmit="notyet(); return false">
|
dreamcatcher

msg:1494332 | 1:06 pm on Jun 9, 2003 (gmt 0) |
Thanks for the tips. I haven`t added "return false" and the code works just fine, the form doesn`t get submitted. :)
|
ShawnR

msg:1494333 | 1:24 pm on Jun 9, 2003 (gmt 0) |
"...haven`t added "return false" and the code works just fine, the form doesn`t get submitted...." Probably because you don't have an action="..." attribute in your <form...> tag yet.
|
dreamcatcher

msg:1494334 | 5:37 pm on Jun 9, 2003 (gmt 0) |
"Probably because you don't have an action="..." attribute in your <form...> tag yet." Thats correct, I don`t. :) I have changed it to return false though, because that removes the click action when the button is pressed and I like it better like that. Whilst we are on the subject of this, how about if I want someone to confirm an action before the action is completed? Say I had "Delete" button and I wanted a box to pop us saying "Are you Sure?", how would I do that? So that yes returns true and no returns false? Thank you. :)
|
korkus2000

msg:1494335 | 5:40 pm on Jun 9, 2003 (gmt 0) |
function submitConfirmation(){ var confirmSub = confirm("Are you Sure?"); if (confirmSub){ return true; }else{ return false; }
|
dreamcatcher

msg:1494336 | 6:35 pm on Jun 9, 2003 (gmt 0) |
Thank you korkus2000. Appreciate the help :)
|
|