s20001321
05-04-2009, 03:30 AM
I am a newbie in HTML/XHTML…I have met some problems when performing the specific tasks…
1 –
…
<script type = "text/javascript">
function EmailCheck()
{
var mail = document.getElementById("email").value;
var pattern = /([0-9a-zA-Z_-]+)@([0-9a-zA-Z_-]+)\.([0-9a-zA-Z_-]+)/;
if (!pattern.test(mail))
{
alert("Invalid Email Address");
}
else
{
alert("valid Email Address");
}
}
</script>
…
<form method="get" action="http://xxxxxx.php">
<table border="1" cellspacing="0" cellpadding="2">
<tr>
<th colspan="2">Newsletter Signup</th>
</tr>
<tr>
<td>Email</td>
<td><input id="Email" type="text" /><input type="button" value="Check" /></td>
</tr>
<tr>
<td> </td>
<td>Please send me newsletter<input id="monthly" type="checkbox" /></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" id="Send" value="Send" /></td>
</tr>
</table>
</form>
How to validate the E-mail address and send the email address to “http://xxxxxx.php” at the same time by using “get” method when click the “Send” button?? Also, how to “Stop” action when the e-mail address is incorrect?
2 –
…
<form id="feedback" method="post" action="http://xxxxxx.php">
<table border="1" cellspacing="0" cellpadding="2">
<tr>
<th colspan="2">Feedback Form</th>
</tr>
<tr>
<td>Name</td>
<td><input id="name" type="text" /></td>
</tr>
<tr>
<td>Email</td>
<td><input id="Email" type="text" /></td>
</tr>
<tr>
<td>Subject</td>
<td><input id="Subject" type="text" /></td>
</tr>
<tr>
<td>Comments</td>
<td><textarea id="textarea" cols="30" rows="10"></textarea></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" id="Send" value="Send" /></td>
</tr>
</table>
</form>
How to use JavaScript to validate all of the above fields including verifying the email address? Also, how to use “Post” method to send the information to “http://xxxxxx.php”??
3 –
…
<table border="2" cellspacing="3" cellpadding="4">
<tr>
<th colspan="10">aaa</th>
</tr>
<tr>
<td><a href="xxx.htm"><img src="yyy.jpg" alt="zzz" /></a></td>
…
For this part, it needs to read the data from .txt file and is separated by “,”…and then display the content in the .htm...How to do it???
These are the few lines in .txt:
itemname,Price,size,in stock,colour
[Bedroom]
single bed,$160,single,yes,wood
double bed,$300,double,yes,wood
…
Million thanksss…
1 –
…
<script type = "text/javascript">
function EmailCheck()
{
var mail = document.getElementById("email").value;
var pattern = /([0-9a-zA-Z_-]+)@([0-9a-zA-Z_-]+)\.([0-9a-zA-Z_-]+)/;
if (!pattern.test(mail))
{
alert("Invalid Email Address");
}
else
{
alert("valid Email Address");
}
}
</script>
…
<form method="get" action="http://xxxxxx.php">
<table border="1" cellspacing="0" cellpadding="2">
<tr>
<th colspan="2">Newsletter Signup</th>
</tr>
<tr>
<td>Email</td>
<td><input id="Email" type="text" /><input type="button" value="Check" /></td>
</tr>
<tr>
<td> </td>
<td>Please send me newsletter<input id="monthly" type="checkbox" /></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" id="Send" value="Send" /></td>
</tr>
</table>
</form>
How to validate the E-mail address and send the email address to “http://xxxxxx.php” at the same time by using “get” method when click the “Send” button?? Also, how to “Stop” action when the e-mail address is incorrect?
2 –
…
<form id="feedback" method="post" action="http://xxxxxx.php">
<table border="1" cellspacing="0" cellpadding="2">
<tr>
<th colspan="2">Feedback Form</th>
</tr>
<tr>
<td>Name</td>
<td><input id="name" type="text" /></td>
</tr>
<tr>
<td>Email</td>
<td><input id="Email" type="text" /></td>
</tr>
<tr>
<td>Subject</td>
<td><input id="Subject" type="text" /></td>
</tr>
<tr>
<td>Comments</td>
<td><textarea id="textarea" cols="30" rows="10"></textarea></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" id="Send" value="Send" /></td>
</tr>
</table>
</form>
How to use JavaScript to validate all of the above fields including verifying the email address? Also, how to use “Post” method to send the information to “http://xxxxxx.php”??
3 –
…
<table border="2" cellspacing="3" cellpadding="4">
<tr>
<th colspan="10">aaa</th>
</tr>
<tr>
<td><a href="xxx.htm"><img src="yyy.jpg" alt="zzz" /></a></td>
…
For this part, it needs to read the data from .txt file and is separated by “,”…and then display the content in the .htm...How to do it???
These are the few lines in .txt:
itemname,Price,size,in stock,colour
[Bedroom]
single bed,$160,single,yes,wood
double bed,$300,double,yes,wood
…
Million thanksss…