Java Reference
In-Depth Information
The remaining three rows in the table contain two password fi elds and the Submit button (the smart
form currently does not use these fi elds).
<!-- HTML continued from earlier -->
<tr>
<td class=”fieldname”>
Password:
</td>
<td>
<input type=”text” id=”password” />
</td>
<td />
</tr>
<tr>
<td class=”fieldname”>
Verify Password:
</td>
<td>
<input type=”text” id=”password2” />
</td>
<td />
</tr>
<tr>
<td colspan=”2” class=”submit”>
<input type=”submit” value=”Submit” />
</td>
<td />
</tr>
</table>
</form>
The CSS in this HTML page consists of only a couple of CSS rules.
.fieldname
{
text-align: right;
}
.submit
{
text-align: right;
}
These rules align the fi elds to give the form a clean and unifi ed look.
As stated earlier, the hyperlinks are key to the Ajax functionality, as they call JavaScript functions when
clicked. The fi rst function, checkUsername() , retrieves the text the user entered into the Username
fi eld and performs an HTTP request using that information.
function checkUsername()
{
var userValue = document.getElementById(“username”).value;
if (userValue == “”)
{
Search WWH ::




Custom Search