Try removing the onSubmit attribute of your form and then having a
function that the other links on the page call manually submitting
the form, after they have run. I'm thinking something like this:

<script language="javascript">
function doSubmit(form)
{
  return test_alert();
  form.submit;
}
</script>

<form action="addsi.cfm" method="post" name="siDetailsAdd">
      <a href="#" onClick="doSubmit(document.siDetailsAdd)" class="link">Add</a>
</form>

HTH,
Vaughan

Tuesday, February 24, 2004, 3:02:16 PM, you wrote:

KB> It submits the correct form, as it goes to the correct page, it just ignores
KB> the onsubmit attribute in the form tag.  In the below code clicking on the
KB> add will direct the browser to addsi.cfm.  It does not do the
KB> onsubit="test_alert", which pops an alert box that says test.  If I replace
KB> the add link with a normal input type="submit" then it all works.

KB> Brian

KB> <form action="addsi.cfm" method="post" name="siDetailsAdd"
KB> onSubmit="test_alert()">

KB> <a href="#" onClick="document.siDetailsAdd.submit()" class="link">Add</a>

KB> </form>

>> -----Original Message-----
>> From: Steve Baty [SMTP:[EMAIL PROTECTED]
>> Sent: Tuesday, 24 February 2004 13:56
>> To:   CFAussie Mailing List
>> Subject:      [cfaussie] RE: Javascript problem
>> 
>> Brian,
>> 
>> You may need to specify the form to submit, either by
>> onclick(this.submit()), or onclick(document.formname.submit());
>> 
>> Not sure that will help, but worth a shot...
>> 
>> Cheers
>> Steve
>> 
>> -----------------------------------
>> Steve Baty - senior analyst
>> p: 612 8596 4030
>> m: 0417 061 292
>> f: 612 8596 4001
>> e: steve @redsquare.com
>>  
>> 
>> -----Original Message-----
>> From: [EMAIL PROTECTED]
>> [mailto:[EMAIL PROTECTED] On Behalf Of KNOTT,
>> Brian
>> Sent: Tuesday, 24 February 2004 2:53 PM
>> To: CFAussie Mailing List
>> Subject: [cfaussie] Javascript problem
>> 
>> Not sure how many people are out there with MXDU on but I have a
>> javascript
>> problem.
>> 
>> I have a onsubmit attribute in my form tag but If I use a link and do a
>> onclick(submit()) it ignores the onsubmit in the form tag.
>> 
>> There are 3 forms on the page but they all have separate form tags, not
>> sure
>> if these are causing the problem.
>> 
>> Brian Knott
>> 
>> 
>> 
>> 
>> ------------------------------------------------------------------------
>> -----------
>> 
>> The contents of this message are the views of the Author and do not
>> necessarily reflect the views of SUNCORP METWAY LTD  ABN 66 010 831 722.
>> 
>> 
>> The content of this e-mail, including attachments is a confidential
>> communication between the Suncorp Metway Group and the intended
>> addressee. Any unauthorised use of the contents is expressly prohibited.
>> If you have received this e-mail in error please contact the sender
>> immediately and then delete the message and any attachment(s).
>> 
>> http://www.suncorp.com.au
>> 
>> 
>> ---
>> You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
>> To unsubscribe send a blank email to
>> [EMAIL PROTECTED]
>> 
>> MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
>> http://www.mxdu.com/ + 24-25 February, 2004
>> 
>> 
>> ---
>> You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
>> To unsubscribe send a blank email to
>> [EMAIL PROTECTED]
>> 
>> MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
>> http://www.mxdu.com/ + 24-25 February, 2004

KB> ---
KB> You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
KB> To unsubscribe send a blank email to [EMAIL PROTECTED]

KB> MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
KB> http://www.mxdu.com/ + 24-25 February, 2004


---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

Reply via email to