Practicals 4
Practicals 4
Generalized form: clicking on a link the left frame enables one to view the linked documents
in the right frame
General format:
<frameset
cols="n1[%],n2[%]" ***specifies number and widths of frame as %s of width of browser
rows="n1[%],n2[%]" ***Specifies number and height of frames as %s of height of browser
frameborder="1|0" ***specifies whether a 3-D border should be displayed btn frames.
bordercolor="color"
framespacing="n" ***amount of spacing between frames (in px)
>
...
</frameset>
Example:
</frameset>
</html>
Students to read:
The scrolling attribute, marginwidth attribute, marginheight, Nested frames, Targetting
frames, Document coding
1
FORMS
A data capture device that allows users to interact with the page. These are a variety of
standard controls that can be coded on a Web form….
XHTML forms are backed by processing routines written in languages like VB, PHP or Java.
Textbox controls
2
EXAMPLE:
<form>
<p>Please enter the following information :</p>
<table>
tr>
<td>Name: </td>
<td><input id="TheName" type="text"/></td>
</tr>
<tr>
<td>Password: </td>
<td><input id="ThePassword" type="password"/></td>
</tr>
<tr>
<td>City: </td>
<td><input type="text" id="City" size="15"/></td>
</tr>
<tr>
<td>Region: </td>
<td><input type="text" id="Region" size="3"/></td>
<tr>
<td>GPS </td>
<td><input type="text" id="GPS" size="11"/></td>
</tr> </table>
</form>
A textbox can include the value attribute to pre-enter text in the field, like a tool-tip.
Name: <input type="text" id="FullName" size="30" value="Enter your full name here"/>
Radio Buttons
<input type="radio"
id="id"
name="name"
value="text"
checked="checked"
/>
3
Example:
<p>What is your favorite color?</p>
<input type="radio" name="Color" value="Red" checked=”checked”/>Red<br/>
<input type="radio" name="Color" value="Green"/>Green<br/>
<input type="radio" name="Color" value="Blue"/>Blue<br/>
Checkboxes
<input type="checkbox"
id="id"
name="name"
value="text"
checked="checked"
/>
General format:
<select
id="id"
name="name"
size="n"
multiple="multiple"
>
<option
value="text"
selected="selected"
>
Label
</option>
...
</select>
4
Choose your favorite color:<br/>
<select id="Color" size="4"> **Size shows number to be displayed at a time
<option value="R">Red</option>
<option value="G">Green</option>
<option value="Y">Yellow</option>
<option value="V">Violet</option>
<option value="O">Orange</option>
<option value="A">Aqua</option>
<option value="B">Black</option>
</select>
Multiple attributes
Submit Button
<input type="submit"
id="id"
name="name"
value="text"
/>
Example:
Reset Button
<input type="reset"/>
Students to Read:
The mailto: Action, Using FTP to Publish Files, FTP