Add JavaScript to one page in WordPress
-
I’m hope someone can help me set up JavaScript for us one page in WordPress.
I’d like to automatically generate the values of the following:
Total for Attendee Reservations – (Sum of number of attendees multiplied by option value) (example: 4*$75= $300)
Total – (sum of reservation total & additional donation)
What Javascript code do I need and can I put it directly into the page? I saw somewhere that it might be better to create a custom fields with the javascript code. Any help would be much appreciated!Here is the code:
<table width="600" border="0" cellspacing="5" cellpadding="5"> <tbody> <tr> <td align="right" width="213"></td> <td width="719"><strong>Reservations</strong></td> </tr> <tr> <td>Number of Attendees</td><td><select name="Quantity1" id="Quantity1"> <option value="0">0</option> <option value="1">1</option> <option value="2" selected>2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> </select> </td><td> <input id="ItemID1" type="hidden" name="ItemID1" value="1" /> <input id="ItemName1" type="hidden" name="ItemName1" value="Adult Ticket" /> <input id="UnitPrice1" type="hidden" name="UnitPrice1" value="75" /> <input id="UnitDeductible1" type="hidden" name="UnitDeductible1" value="100%" /></td> </tr> <tr> <td align="right">Total for Attendee Reservations</td> <td> Sum of number of attendees multiplied by option value) (example: 4*$75= $300)<td> </tr> <tr> <td align="right" width="213">Additional Donation</td> <td><input id="UnitPrice2" type="text" name="UnitPrice2" size="5" /> <input id="Quantity2" type="hidden" name="Quantity2" size="5" value="1" /> <input id="ItemID2" type="hidden" name="ItemID2" value="2" /> <input id="ItemName2" type="hidden" name="ItemName2" value="Donation" /> <input id="UnitDeductible2" type="hidden" name="UnitDeductible2" value="100%" /></td> </tr> <tr> <td align="right">Total</td> <td> (sum of reservation total & additional donation)</td></tr> </table>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Add JavaScript to one page in WordPress’ is closed to new replies.