PDA

Click to See Complete Forum and Search --> : submit javascript question w/ forms


pnj
Mar 15th, 2001, 10:43 AM
ok,this works
<a href="somepage.htm" onClick="javascript:document.myForm.submit();">submit</a>

but I need to run use a confirm box before I submit the form.

so I am trying this:

<script>
function ConfirmDelete()
{
if (!confirm)
{return false;}
else
{document.myForm.submit;}
</script>

I don't get an error message but it dosen't submit the form either.

I tried to use location.href but i need to pass some name/value pairs and i couldn't get the variables into my javascript from the asp.


any suggestions?

thanks

Cander
Mar 15th, 2001, 02:02 PM
function PrintConfirm()
{
var agree=confirm("Are you sure you wish to do this?");

if (agree) {

document.myForm.submit();
}
else {
return false; }
}

pnj
Mar 15th, 2001, 03:03 PM
i got it.
i was doing it with
<a href="#" onClick="callFunction">

and it needed to be

<a href="javascript:callFunction">

this works.

whoo-ho!