Código:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <!-- Suma --> <script type="text/javascript"> function Sumar(){ interval = setInterval("calcular()",1); } function calcular(){ uno = document.autoSumForm.Simple.value; dos = document.autoSumForm.Doble.value; tres = document.autoSumForm.Matrimonial.value; cuatro = document.autoSumForm.Familiar.value; cinco = document.autoSumForm.Adicional.value; seis = document.autoSumForm.Noches.value; siete = document.autoSumForm.subtotal.value; document.autoSumForm.subtotal.value = (uno * 30) + (dos * 50) + (tres * 50) + (cuatro * 70) + (cinco * 20); document.autoSumForm.total.value = (siete * 1) * (seis * 1); } function NoSumar(){ clearInterval(interval); } </script> <!-- Fin suma --> <form id="autoSumForm" name="autoSumForm" method="post" action="Reservar.php"> <h2>Datos Personales </h2> <table width="600" border="0" align="center"> <tr> <td align="right">Nombres y Apellidos: </td> <td align="left"> <label> <input name="nombre" type="text" id="nombre" size="31" /> </label></td> </tr> <tr> <td align="right">Pais de Origen: </td> <td align="left"><label> <input name="pais" type="text" id="pais" size="31" /> </label></td> </tr> <tr> <td align="right">Documento de identidad: </td> <td align="left"> <label> <input name="passport" type="text" id="passport" size="31" /> </label></td> </tr> <tr> <td align="right">Fecha de Nacimiento (dd/mm/aaaa): </td> <td align="left"><label> <input name="nacimiento" type="text" id="nacimiento" size="31" /> </label></td> </tr> <tr> <td align="right">Telefono de Contacto: </td> <td align="left"><label> <input name="telefono" type="text" id="telefono" size="31" /> </label></td> </tr> <tr> <td align="right">Correo electrónico: </td> <td align="left"> <label> <input name="email" type="text" id="email" size="31" /> </label></td> </tr> <tr> <td> </td> <td align="left"> </td> </tr> <tr> <td> </td> <td align="left"> </td> </tr> <tr> <td> </td> <td align="left"> </td> </tr> <tr> <td> </td> <td align="left"> </td> </tr> </table> <h2> Datos de Reserva</h2> <h5> </h5> <table width="600" border="0"> <tr> <td width="150">Habitacion Simple</td> <td width="150">Habitacion Doble</td> <td width="150">Habitacion Matrimonial</td> <td width="150">Habitacion Familiar</td> <td width="150">Cama adicional</td> <td>Número de noches</td> </tr> <tr> <td><label> <select name="Simple" id="Simple" onfocus="Sumar();" onblur="NoSumar();"> <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> </label></td> <td> <label> <select name="Doble" id="Doble" onfocus="Sumar();" onblur="NoSumar();"> <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> </label></td> <td><label> <select name="Matrimonial" id="Matrimonial" onfocus="Sumar();" onblur="NoSumar();"> <option>0</option> <option>1</option> <option>2</option> <option>3</option> </select> </label></td> <td><label> <select name="Familiar" id="Familiar" onfocus="Sumar();" onblur="NoSumar();"> <option>0</option> <option>1</option> <option>2</option> </select> </label></td> <td> <label> <select name="Adicional" id="Adicional" onfocus="Sumar();" onblur="NoSumar();"> <option>0</option> <option>1</option> <option>2</option> <option>3</option> <option>4</option> </select> </label></td> <td><select name="Noches" id="Noches" onfocus="Sumar();" onblur="NoSumar();"> <option selected="selected">1</option> <option>2</option> <option>3</option> <option>5</option> <option>6</option> <option>7</option> <option>8</option> <option>9</option> <option>10</option> </select></td> </tr> <tr> <td colspan="2"> </td> <td> </td> <td> </td> <td><input name="subtotal" type="text" class="cajon" id="subtotal" /></td> <td><input name="total" type="text" class="cajon" id="total" /></td> </tr> <tr> <td colspan="3"> </td> <td colspan="3"> </td> </tr> <tr> <td colspan="3"> </td> <td colspan="3"> </td> </tr> <tr> <td colspan="3"> </td> <td colspan="3"> </td> </tr> <tr> <td colspan="6"> </td> </tr> <tr> <td colspan="6"><select name='arrival_day' onchange='triggerDates(document.searchAgain.arrival_day[document.searchAgain.arrival_day.selectedIndex].value, document.searchAgain.arrival_month[document.searchAgain.arrival_month.selectedIndex].value,document.searchAgain.arrival_year[document.searchAgain.arrival_year.selectedIndex].value)'> <option value='1'>01</option> <option value='2'>02</option> <option value='3'>03</option> <option value='4'>04</option> <option value='5'>05</option> <option value='6'>06</option> <option value='7'>07</option> <option value='8'>08</option> <option value='9'>09</option> <option value='10'>10</option> <option value='11'>11</option> <option value='12'>12</option> <option value='13'>13</option> <option value='14' selected="selected">14</option> <option value='15'>15</option> <option value='16'>16</option> <option value='17'>17</option> <option value='18'>18</option> <option value='19'>19</option> <option value='20'>20</option> <option value='21'>21</option> <option value='22'>22</option> <option value='23'>23</option> <option value='24'>24</option> <option value='25'>25</option> <option value='26'>26</option> <option value='27'>27</option> <option value='28'>28</option> <option value='29'>29</option> <option value='30'>30</option> <option value='31'>31</option> </select> <select name='arrival_month' onchange='triggerDates(document.searchAgain.arrival_day[document.searchAgain.arrival_day.selectedIndex].value, document.searchAgain.arrival_month[document.searchAgain.arrival_month.selectedIndex].value,document.searchAgain.arrival_year[document.searchAgain.arrival_year.selectedIndex].value)'> <option value='0'>Jan</option> <option value='1'>Feb</option> <option value='2'>Mar</option> <option value='3'>Apr</option> <option value='4'>May</option> <option value='5' selected="selected">Jun</option> <option value='6'>Jul</option> <option value='7'>Aug</option> <option value='8'>Sep</option> <option value='9'>Oct</option> <option value='10'>Nov</option> <option value='11'>Dec</option> </select> <select name='arrival_year' onchange='triggerDates(document.searchAgain.arrival_day[document.searchAgain.arrival_day.selectedIndex].value, document.searchAgain.arrival_month[document.searchAgain.arrival_month.selectedIndex].value,document.searchAgain.arrival_year[document.searchAgain.arrival_year.selectedIndex].value)'> <option value='2010' selected="selected">2010</option> <option value='2011'>2011</option> <option value='2012'>2012</option> <option value='2013'>2013</option> </select></td> </tr> <tr> <td colspan="6">Comentarios adicionales:</td> </tr> <tr> <td colspan="6"><textarea name="mensaje" id="mensaje" rows="5" cols="25"></textarea> </td> </tr> </table> <br> <br/> <br /> <br /> <label> <input type="submit" name="Submit" value="Reservar ahora" /> </label> </p> </form> </body> </html>