|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I am trying to figure out how I can use javascript to multiply the quantity of items and the price per unit. Then pass the result value to another form on another page.
can anyone help me out please? |
|
#2
|
|||
|
|||
|
If you want to take 2 values on a form, multiply them, and pass the value to another form, you could try: <script> fuction DoIt() { theVal = document.theForm.item1.value * document.theForm.item2.value; theURL = "http://path.to.page/page.html?val=" & theVal; self.location.href = theURL; } </script> Now, I would normally pass that on to a Perl or ASP page. To be honest, I am not sure if HREF'ing to an HTML page will keep a query string intact. But whatever. Good luck. |
|
#3
|
|||
|
|||
|
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by nine:
I am trying to figure out how I can use javascript to multiply the quantity of items and the price per unit. Then pass the result value to another form on another page. can anyone help me out please?[/quote] I would think that using a submit button (with onClick="passValues(this.form)") on the first form to call this function would work: function passValues(form){ form2.totcost.value=form.quantity.value*form.price.value; } |
![]() |
| Viewing: Dev Shed Forums > Web Design > HTML Programming > How can I multiply two values in a form then pass the result to another form ? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|