This is what I use, it references the form by it's index on the page IE:
document.forms[0] is the first form on the page and document.forms[1] would
be the second and so on.
<html>
<head>
<script>
<!-- Begin
function redirectAndSubmit(theForm,theURL){
theForm.action = (theURL);
theForm.submit();
}
//-->
</script>
<title>Untitled</title>
</head>
<body>
<form name="whatever" ACTION="" METHOD="post">
This Form is posting to itself
<input type="button" name="button1" value="Button 1"
onclick="redirectAndSubmit(document.forms[0],'untitled1.cfm?action=add')">&n
bsp;
<input type="button" name="button2" value="button 2"
onclick="redirectAndSubmit(document.forms[0],'untitled1.cfm?action=delete')"
>
</form>
</body>
</html>
Doug
----- Original Message -----
From: "Angel Stewart" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, November 13, 2001 2:48 PM
Subject: RE: More OT Javascript: Dual Submit Buttons on One Form.
> Umm..
> I tried that..a new name and stuff.
>
> <input name="Deletebutton" type="button" value="Add More"
> onclick="document.Timeentry_billable.action='timeentry_deletechargeinfo.
> cfm';document.Timeentry_billable.submit();" class="buttons">
>
> And I still get that same exact error. It is driving me nuts..I can't
> understand! :-\
>
> -Gel
>
> -----Original Message-----
> From: Craig [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, November 13, 2001 6:27 PM
> To: CF-Talk
> Subject: Re: More OT Javascript: Dual Submit Buttons on One Form.
>
>
> I get that all of the time. Name your submit button something else. I
> think it has a default name as submit, so when you call the submit
> method:
>
> document.Timeentry_billable.submit();
>
> It thinks you are referring to the submit button, not the form's method.
>
> so you need something like:
>
> <input type="submit" name="MyDeleteButton" value="delete" >
>
> -Craig
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Your ad could be here. Monies from ads go to support these lists and provide more
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists