Brett,

That's no problem.  Add a hidden element to the form, with a name but no
value.  Set the appropriate value in each of the onclick handlers.  The
form's action page should then check the value of the hidden form
element.

<input type="hidden" name="submitType">

<a href="#"
onclick="document.myForm.submitType.value='A';document.myForm.submit();re
turn false;">Click to submit A</a>
<a href="#"
onclick="document.myForm.submitType.value='B';document.myForm.submit();re
turn false;">Click to submit B</a>

The action page can check the value of FORM.submitType and act
accordingly.

-David

On Fri, 03 Nov 2000 22:28:50 +0800 Brett Payne-Rhodes <[EMAIL PROTECTED]>
writes:
> This is a question I have been wondering about for a while myself...
> Thanks to Peter, Rob and David for their contributions, and I have
> managed to use the solution on a simple form. But what about a more
> complicated form that has three 'submit' buttons; 'Add' 'Update' and
> 'Delete'? Using the standard 'input type="submit"' method you
> differentiate between the buttons by value, but it seems that when 
> using
> the javascript solution I don't see the 'button' that was pressed, 
> even
> if I name the images. I had a look in Goodman's Javascript Bible but
> found little to help - but its a big book and I'll keep looking...
> 
> In the meantime, can anyone shed any more light on this please?
> 
> Many Thanks,
> 
> Brett Payne-Rhodes
> B)
> 
> "Joseph J. Sanger, M.D." wrote:
> > 
> > This is simple, but I am not a javascript maven .... I wish to 
> submit
> > a form by clicking in a link, rather than pressing the submit 
> button.
> > Isn't this possible with some javascript function in the URL of 
> the
> > anchor?  Could someone remind me what this should look like?  
> Thanks
> > very much.

________________________________________________________________
YOU'RE PAYING TOO MUCH FOR THE INTERNET!
Juno now offers FREE Internet Access!
Try it today - there's no risk!  For your FREE software, visit:
http://dl.www.juno.com/get/tagj.
------------------------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message 
with 'unsubscribe' in the body to [EMAIL PROTECTED]

Reply via email to