想问各位如果我要加subtotal和total进去我的webpage里面,就好象tgv或gsc的cinema网上订票一样,
在dropbox那边我选什么quantity,subtotal和total都会在同一个webpage里面Update和显示出来,是应该怎样写code呢?
以下我用alert的觉得很奇怪,谁可以指导我呢?先说声谢谢
复制代码
- <form id="form1" name="form1" method="post" action="getcashprocess.php">
- <table cellSpacing="0" cellPadding="0" width="500" border="0">
- <td width="154" align="center">Ticket Type</td>
- <td width="67" align="center">Qty</td>
- <td width="86" align="center">Cost(RM)</td>
- <td width="100" align="center">Subtotal(RM)</td>
- <tr>
- <td width="154" align="center" ><p>1.Children</p> <p>2.Adult(Above age 18)</p>
- <p>3.Twin Seat</p></td>
- <td width="67" align="center"><p>nbsp;</p>
- <p>
- <label>
- <select name="qty" id="qty" tableindex="1"
- onchange="showOption(this.options[this.options.selectedIndex].value)">
- <option value="0">0</option>
- <option value="1">1</option>
- <option value="2">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>
- </label>
- </p>
- <p>
- <label>
- <select name="qty2" id="qty2" tableindex="1"
- onchange="showOption1(this.options[this.options.selectedIndex].value)">
- <option value="0">0</option>
- <option value="1">1</option>
- <option value="2">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>
- </label>
- </p>
- <p>
- <select name="qty3" id="qty3" tableindex="1"
- onchange="showOption2(this.options[this.options.selectedIndex].value)">
- <option>0</option>
- <option>1</option>
- <option>2</option>
- <option>3</option>
- <option>4</option>
- <option>5</option>
- <option>6</option>
- <option>7</option>
- <option>8</option>
- <option>9</option>
- <option>10</option>
- </select>
- </p>
- <p>nbsp;</p>
- <td width="86" align="center"><p>6.00</p>
- <p> 10.00 </p>
- <p>12.00</p></td>
- <td width="100" align="center">
- <p>nbsp;
- <script type="text/javascript">
- function showOption(option) {
- alert("Subtotal(Children) = RM"+(option*6.00));
- }
- function showOption1(option) {
- alert("Subtotal(Adult) = RM"+(option*10.00));
- }
- function showOption2(option) {
- alert("Subtotal(TwinSeat) = RM"+(option*12.00));
- }
- </script></p></td>
- <td width="2"></td>
- </tr>
- <br />
- <tr>
- <td width="91" align="center"></td>
- <td width="154" align="center"></td>
- <td width="86" align="center">
- Total(RM):
- </td>
- </tr>
- <td>Payment type:
- <label>
- <select name="paymenttype" id="paymenttype" tableindex="1">
- <option>Credit Card</option>
- <option>Paypal</option>
- </select>
- </label>
- </td>
- <tr><td>
- <label>
- <input type="submit" name="Submit" value="Submit" />
- </label>
- </td>
- </tr>
- </table>
- </form>
kuang 发表于 2011-5-3 06:34 PM
欢迎光临 JBTALKS.CC (https://www.jbtalks.cc/) | Powered by Discuz! X2.5 |