hinch
08-07-2008, 03:42 PM
I'm a little confused here
I've got a little javascript function for popping up a simple alert box on a link click what I want to do though is to change it from a link to a button in a form.
I've tried making it a <form onSubmit=""> and also tried putting it in the submit onClick it works fine if i have it on a normal href as an onClick just not in the form/button combination what/where am i going wrong :confused:
Javascript
// confirm unassign
function confirmunassign(){
msg = "You are about to unassign this lead are you sure you wish to do this";
return confirm(msg);
}
Form
<form id="editform" name="editform" action="dashboard.php?LoadModule=leads&action=edit&cid=<?php echo $_GET['cid'];?>&Subs=<?php echo $_GET['Subs']?>" method="post">
<input class="button" type="submit" name="actionbutton" id="actionbutton" value="Edit" onClick="return confirmunassign()" />
</form>
Basically if they click no/cancel it needs to not do the submit or if they click ok then it does the submit.
Any help would be much appreciated
I've got a little javascript function for popping up a simple alert box on a link click what I want to do though is to change it from a link to a button in a form.
I've tried making it a <form onSubmit=""> and also tried putting it in the submit onClick it works fine if i have it on a normal href as an onClick just not in the form/button combination what/where am i going wrong :confused:
Javascript
// confirm unassign
function confirmunassign(){
msg = "You are about to unassign this lead are you sure you wish to do this";
return confirm(msg);
}
Form
<form id="editform" name="editform" action="dashboard.php?LoadModule=leads&action=edit&cid=<?php echo $_GET['cid'];?>&Subs=<?php echo $_GET['Subs']?>" method="post">
<input class="button" type="submit" name="actionbutton" id="actionbutton" value="Edit" onClick="return confirmunassign()" />
</form>
Basically if they click no/cancel it needs to not do the submit or if they click ok then it does the submit.
Any help would be much appreciated