Simple javascript help please

  • Thread starter Thread starter Paul M
  • Start date Start date
P

Paul M

Hi
I am trying to store the id of a button into a variable.
Here is the button code

<input type="image" border="0" name="imageField"
src="www.myweb/conferences/book_now_button.gif" width="105" height="22"
alt="Book now" id="but1" />


The idea is that I have two buttons which are sent to different targets
using a function depending on there id's
I need the var only to get its value when one of the buttons is pressed
Thanks
Paul M
 
Hi
I have managed to store a number in a var but the form will not send here is
the code

Here is the url only the contact name has to be entered for the form
validation as yet
http://www.ingenious-group.com/mfgbook/mfgonline.asp

Head
// this captures the input onclick value

<script type="text/javascript">
var xbut="";
</script>


// this is supposed to send the form to different places depending on the
xbut var

rsv.onCompleteHandler = myOnComplete;
function myOnComplete()
{
if (xbut==1)
document.BuyForm.action = 'https://select.worldpay.com/wcc/purchase';

if (xbut==2)
document.BuyForm.action = 'send_invoice.asp';
return false;
}

this is the form button there is another with the onclick="xbut=2 as the
var
<input type="image" border="0" name="imageField"
src="../IGpageimages/conferences/book_now_button.gif" width="105"
height="22" alt="Book now" onclick="xbut=1" id="but1" />


Thanks
Paul M
 
Back
Top