Monday, 24 May 2021

WT-28

 Slip 28

Q Write a JavaScript program to construct the following pattern up to n lines, using a nested     for loop.                                                                                                                                        

*

*          *

 *          *          *

  <html>

<script type="text/javascript">

var i, j;

for(i=1; i <= 3; i++)

{

for(j=1; j<=i; j++)

{

 document.write('*');

}

 document.write('<br/>');

}

</script>

</html>

 

Q2. Design a HTML form for Bus Ticket Reservation consisting of fields for Name, Address, contact no, source station(Dropdown list), Destination station, Date of booking, date of journey, no of passenger, name of passenger, gender of passenger etc. You should provide button to submit as well as reset the form contents. (Use proper alignment)

 <html>

<body>

  <form style="padding:50px; border:10; border-style: solid;">

<Table  height="70%" width="80%">

<font face="arial" size="5" align="center"> Bus Ticket Reservation From </font>

 <tr>

<td>Name: </td>

<td><input type="text" name="First Name"></td>

</tr>

 <tr>

<td>Address: </td>

<td><input type="text" name="First Name"></td>

</tr>

 <tr>

<td>Contact no. </td>

<td><input type="text" name="contact no."></td></tr>

 <tr><td>Station:</td>

<td>

<select>

<option value="Mumbai">Mumbai</option>

<option value="New Delhi">New Delhi</option>

<option value="Bangalore">Bangalore</option>

<option value="London">London</option>

</select></td>

</tr>

 <tr><td>Destination Station: </td>

<td><input type="text" name="First Name"></td></tr>

</tr>

 <tr><td>Date of booking :</td>

<td><input type="date-local"></td></tr>

 <tr><td>Date of Journey :</td>

<td><input type="date-local"></td></tr>

 <tr><td>No. of Passenger: </td>

<td><input type="text" name="contact no."></td></tr>

 <tr><td>Name of Passenger: </td>

<td><input type="text" name="First Name"></td>

</tr>

 <tr><td>Gender: </td>

<td><input type="radio" name="gender" value="male" checked> Male

<input type="radio" name="gender" value="male"> Female</td>

</tr>

 <tr><td>Suggestions</td><td><textarea name="message"></td></tr>

<input type="submit" value="submit" style=" target:submit;">

 </table>

</form>

</body>

</html>