I am trying to create a registration page where username,email,password will be taken from the user
and if user left any field empty on that form then it will display a message stating that field can not be
left empty. I am trying to use AJAX in this web application.
I have added the jar file "org.json-0.0.1.jar" to the classpath of this web application.
The codes of different files are as follows...
register.html
===========
<html>
<head>
<title>Register Page</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script type="text/javascript">
</script>
</head>
<body>
<form>
<table align="center">
<tr>
<td bgcolor="lightgreen" colspan="3">Fill up the form</td>
</tr>
<tr>
<td>User Name</td>
<td><input type="text" name="uname" id="name" onkeyup="sendInfo()"/></td>
</tr>
<tr>
<td>Email</td>
<td><input type="text" name="email" id="mail" onkeyup="sendInfo()"/></td>
</tr>
<tr>
<td>Password</td>
<td><input type="password" name="pass" id="pwd" onkeyup="sendInfo()"/></td>
</tr>
<tr>
<td><input type="submit" value="Register"/></td>
</tr>
</table>
</form>
<div id="errors"></div>
</body>
</html>
RegException.java (This file handles the custom exception)
=====================================
validateServlet.java
=================
After running the web application, if anything is typed(including whitespace character) in any one of the
fields, a the page displays a "null"
word. Please help.