0% found this document useful (0 votes)
102 views27 pages

WT Week-1,2,3

The document describes the code for a bookstore website created using HTML and JavaScript. It includes code for multiple pages like the homepage, login page, catalog, cart, etc. Framesets are used to divide pages into sections. Validation logic in JavaScript ensures fields like username, password, email and phone number adhere to predefined formats before form submission.

Uploaded by

Gipsa Joseph
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
102 views27 pages

WT Week-1,2,3

The document describes the code for a bookstore website created using HTML and JavaScript. It includes code for multiple pages like the homepage, login page, catalog, cart, etc. Framesets are used to divide pages into sections. Validation logic in JavaScript ensures fields like username, password, email and phone number adhere to predefined formats before form submission.

Uploaded by

Gipsa Joseph
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 27

Week-1

1) Home page
homepage.html <html> <head> <title>Frameset page</title> </head> <frameset rows="20%,*"> <frame src="E:/html/topframe.html" name="topframe"/> <frameset cols = "20%, *"> <frame src ="E:/html/leftframe.html" name="leftframe"/> <frame src ="E:/html/rightframe.html" name="rightframe" /> </frameset> </frameset> </html>

topframe.html <html> <head> <title>top_frame </title> </head> <body>

<TABLE border="1" <TR><td valign="middle" align="center" width="100" height="50"> <image src="E:/html/logo.jpeg" height="50" wdth="50" [alt="logo"] [align="center"]/> </td> <TH colspan="4"><h1><u>KGR Book Store</u></h1> <TR> <td valign="middle" align="center" width="200" height="40"><a href="E:/html/welcome.html" target="rightframe"><h3>Home</h3></a></td> <td valign="middle" align="center" width="200" height="40"><a href="E:/html/login.html" target="rightframe"><h3>Login</h3></a></td> <td valign="middle" align="center" width="200" height="40"><a href="E:/html/register.html" target="rightframe"><h3>Registration</h3></a></td> <td valign="middle" align="center" width="200" height="40"><a href="E:/html/catelogue.html" target="rightframe"><h3>Catelogue</h3></a></td> <td valign="middle" align="center" width="200" height="40"><a href="E:/html/cart.html" target="rightframe"><h3>Cart</h3></a></td> </tr> </TABLE> </body> </html>

leftframe.html

<html> <title>navigation_frame</title> <body> <h2><a href="E:/html/cse.html" target="rightframe">CSE</a></h2><br>

<h2><a href="E:/html/ece.html" target="rightframe">ECE</a></h2><br> <h2><a href="E:/html/eee.html" target="rightframe">EEE</a></h2><br> <h2><a href="E:/html/mech.html" target="rightframe">MECH</a></h2><br> <h2><a href="E:/html/civil.html" target="rightframe">CIVIL</a></h2> </body> </html>

rightframe.html

<html> <boby> <h1>Welcome to KGR Book Store.........</h1> <h3>Register to have full access<a href="E:/html/register.html" target="rightframe"><font color="green">REGISTER</font></a><br> If you are an existing user please Login<a href="E:/html/register.html" target="rightframe"><font color="green">LOGIN</font></a><br></h3> <h2><font color="RED">Almost all <font color="purple">(JNYU Syllabus)</font> subject books are available!!!!!</font></h2> </body> </html>

welcome.html

<html> <boby> <h1>Welcome to KGR Book Store.........</h1> <h3>Register to have full access<a href="E:/html/register.html" target="rightframe"><font color="green">REGISTER</font></a><br> If you are an existing user please Login<a href="E:/html/register.html" target="rightframe"><font color="green">LOGIN</font></a><br></h3> <h2><font color="RED">Almost all <font color="purple">(JNTU Syllabus)</font> subject books are available!!!!!</font></h2> </body> </html>

Login.html

<html> <form action="mailto:[email protected]" method="post">

<label> <center> <font face="comic sans ms" color="red" size="5"><b><u>LogIn Page</u></b></font> </center> <font face="comic sans ms" color="Black" size="5">User Name</font>

</label> <input type="text" size="20" maxlength="20" value=' '><br><br><br> <label> <font face="comic sans ms" color="Black" size="5">Password </font> </label> <input type="password" size="20" maxlength="20"> <br><br><br> <input type="submit" value="submit"> </form> </body> </html>

Catalog.html

<html> <body> <center> <table border=1> <tr> <th> Book Preview </th> <th> Book Details </th> <th> Price </th> <th> Payment </th> </tr>

<TR> <td valign="middle" align="center" width="100" height="50"> <img src="E:\html\xml.jpg" height="100" width="50" [alt="xml"] [align="center"]/> </td>

<td> <font face="comic sans ms" size=4 color="green" > book:XML Bible<br> Author:winston<br> Publisher:Wiesley </font> </td>

<td> $40 </td>

<td> <a href="cart.html" target="_blank">

<image src="E:/html/cart.jpg" width="150" height="100"> </a> </td> </tr>

<TR> <td valign="middle" align="center" width="100" height="50"> <image src="E:/html/java2.jpg" height="100" wdth="50" [alt="logo"] [align="center"]/> </td><td>

<font face="comic sans ms" size=4 color="green" > book:Java 2<br> Author:Watson<br> Publisher:BPB publications </font> </td> <td> $63 </td>

<td> <a href="cart.html" target="_blank"> <img src="E:/html/cart.jpg" width="150" height="100"></img>

</a> </td> </tr>

<TR> <td valign="middle" align="center" width="100" height="50"> <image src="E:/html/ai.jpg" height="100" wdth="50" [alt="logo"] [align="center"]/> </td> <td> <font face="comic sans ms" size=4 color="green" > book:AI<br> Author:s.Russel<br> Publisher:Princeton hall </font>

</td> <td> $35.5 </td> <td> <a href="cart.html" target="_blank"> <img src="E:/html/cart.jpg" width="150" height="100"></img> </a> </td> </tr> <TR> <td valign="middle" align="center" width="100" height="50"> <image src="E:/html/html.jpg" height="100" wdth="50" [alt="logo"] [align="center"]/> </td>

<td>

<font face="comic sans ms" size=4 color="green" > book:HTML in 24 hours<br> Author:Sam Peter<br> Publisher:Sam publications </font> </td> <td> $50 </td> <td> <a href="cart.html" target="_blank"> <img src="E:/html/cart.jpg" width="150" height="100"></img> </a> </td> </tr> </table> </center> </body> </html>

Addedcart.html <html> <body> <center> <img src="E:\html\addtocart.jpg" /> <h2><font color="purple" style="Comic Sans MS"> Added to Cart...</font></h2> <a href="E:\html\catelogue.html" target="rightframe"> <input type="button" name="back" value="Go Back to Catelogue" > </a>

</center> </body> </html>

Cse.html

<html> <boby> this is cse page </body> </html>

Ece.html

<html> <boby> this is ece page </body> </html>

Eee.html

<html> <boby> this is eee page </body> </html> mech.html

<html> <boby>

this is mechanical page </body> </html>

civil.html

<html> <boby> this is civil page </body> </html>

Week-2 Cart.html <html> <body> <center><br><br><br> <img src="E:\html\addtocart.jpg" height="100" width="100"> <table border=1 cellpadding=center> <thead> <tr> <th>Book name</th> <th>price</th> <th>quantity</th> <th>amount</th> </tr> </thead> <tr> <td>java 2</td>

<td>$45</td> <td>2</td> <td>$70</td> </tr> <tr> <td> XML bible</td> <td> $20</td> <td> 5</td> <td> $40</td> </tr> <th colspan=4>total amount=$110> </th> </tr> </table> </center> </body> </html>

Register.html

<html> <body><form action="mailto:[email protected]" method="post">

<center><font face="comic sans ms" color="red" size="5"><b><u>Registration Page</u></b></font></center> <b> <label>Name</label>

<input type="text" size="20"><br> <label>Password</label> <input type="password" size="20" maxsize="28"><br> <label>Email</label> <input type="text" size="30"><br> <label>Phone no</label> <input type="text" size="2"> <input type="text" size="6"> <input type="text" size="10"><br> <label>Sex</label> <input type="radio" name="sex">m <input type="radio" name="sex">f <br> <label> Date of Birth</label> <select> <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> <option>11</option>

<option>12</option> <option>13</option> <option>14</option> <option>15</option> <option>16</option> <option>17</option> <option>18</option> <option>19</option> <option>20</option> <option>21</option> <option>22</option> <option>23</option> <option>24</option> <option>25</option> <option>26</option> <option>27</option> <option>28</option> <option>29</option> <option>30</option> <option>31</option>

</select> <select> <option>jan</option> <option>feb</option>

<option>mar</option> <option>apr</option> <option>may</option> <option>jun</option> <option>jul</option> <option>aug</option> <option>spt</option> <option>oct</option> <option>nov</option> <option>dec</option> </select> <select> <option>1987</option> <option>1988</option> <option>1989</option> <option>1990</option> <option>1991</option> <option>1992</option> <option>1993</option> </select> <br> <label> Languages Known </label> <input type="checkbox"> English <input type="checkbox"> Telugu <input type="checkbox"> Hindi <input type="checkbox"> Malayalam

<input type="checkbox"> Tamil<br> <label> Address </label> <textarea rows=5 cols=20 scrolling="yes"> </textarea> <br><br> <input type="submit" value="Submit"> <input type="reset"> </b> </body> </html>

Week-3

Valid.js function fun() {

var userv=document.forms[0].user.value;

var pwdv=document.forms[0].pwd.value; var emailv=document.forms[0].email.value; var phv=document.forms[0].ph.value; var userreg=new RegExp("^[a-zA-Z][a-zA-Z0-9]*$");

var emailreg=new RegExp("^[a-zA-Z][a-zA-Z0-9_.]*@[a-zA-Z][a-zA-Z0-9_.]*.[azA-Z][a-zA-Z0-9_.]{2}.[a-zA-Z][a-zA-Z0-9_.]{2}$|^[a-zA-Z][a-zA-Z0-9_.]*@[a-zA-Z] [a-zA-Z0-9_.]*.[a-zA-Z][a-zA-Z0-9_.]{3}$"); var phreg=new RegExp("^[0-9]{10}$"); var ruser=userreg.exec(userv);

var remail=emailreg.exec(emailv); var rph=phreg.exec(phv); if(ruser && remail && rph && (pwdv.length > 6)) { alert("All values are valid"); return true; } else { if(!ruser) { alert("username invalid");document.forms[0].user.focus();} if(!remail) { alert("password invalid");document.forms[0].user.focus();} if(!rph) { alert("phone number invalid");document.forms[0].ph.focus();} if(pwdv.length < 6) { alert("password invalid");document.forms[0].pwd.focus();} return false; }

Register.html

<html> <body> <center> <fieldset> <legend>Registration</legend> <form action="Database" method="get" onSubmit="return fun()"> <pre> Name Password E-mail Phone Number :<input type="text" name="user" size="10"><br> :<input type="password" name="pwd" size="10"><br> :<input type="text" name="email" size="10"><br> :<input type="text" name="ph" size="10"><br>

<input type="submit" value="Register"> </pre> </form> </body> <script src="valid.js"></script> </html>

You might also like