Results 11 to 17 of 17
Hybrid View
-
28th Apr 2012, 01:37 PM #1Respected MemberWebsite's:
DL4Everything.com Soft2050.inPHP Code:if (x.length >= 40) {
alert("Too much");
} else if(x.length =< 3) {
//ahh;
alert("Too Less");
} else {
//ok;
}
soft2050 Reviewed by soft2050 on . Help Need In Making Assisgnment JavaScript Hello i got assignment from my university i am not able to make it properly doing some mistakes well got this assignment Make a form in HTML document containing only one field named as Email and one Submit Button. Write your own JavaScript function to validate the email address. The Validation should be as follows: It must accept only your VU Student email address i.e; it must not accept any other student’s VU email address. Rating: 5
-
28th Apr 2012, 01:32 PM #2MemberWebsite's:
imdber.org justpaste.meYou should practise indenting your code (and adding comments), it makes your code readable.
-
28th Apr 2012, 01:35 PM #3OPMemberWebsite's:
TeamUploads.com GamerW.netthanks buddy for your idea i am trying it my self alot actually i love PHP and have knowledge about PHP, i totally forget javascript thats why i am asking here for help.
-
28th Apr 2012, 01:44 PM #4OPMemberWebsite's:
TeamUploads.com GamerW.netbut how i can implement your code in fields ?
Code:if (x.length >= 40) { alert("Too much"); } else if(x.length =< 3) { //ahh; alert("Too Less"); } else { //ok; }
-
28th Apr 2012, 01:47 PM #5Respected MemberWebsite's:
DL4Everything.com Soft2050.inBefore checking any other checks
PHP Code:<html>
<head>
<script type="text/javascript">
function CheckMyEmail()
{
var x=document.forms["myForm"]["email"].value;
if (x.length >= 40) {
alert("Too much");
} else if(x.length =< 3) {
//ahh;
alert("Too Less");
} else {
//ok;
var value=("BC102034568");
var at=x.indexOf("@");
var dot=x.lastIndexOf("vu.edu.pk");
if (at<1 || dot<at+1 || dot+2>=x.length)
{
alert( x + " is Not your valid VU e-mail address");
}
else
{
if(x=="BC102034568@vu.edu.pk")
{
alert( x + " is your valid VU e-mail address");
return true;
}
else
{
alert( x + " is not an valid email address");
}
}
}
return false;
}
</script>
</head>
<body>
<form name="myForm" action="example.html" onsubmit="return CheckMyEmail();" method="post">
Email: <input type="text" name="email">
<input type="submit" value="Submit">
</form>
</body>
</html>
-
28th Apr 2012, 01:50 PM #6OPMemberWebsite's:
TeamUploads.com GamerW.netNot worked.............
-
28th Apr 2012, 01:59 PM #7Respected MemberWebsite's:
DL4Everything.com Soft2050.inAhh, yeah, a small type in the comparison operator: =<
PHP Code:<html>
<head>
<script type="text/javascript">
function CheckMyEmail()
{
var x=document.forms["myForm"]["email"].value;
if (x.length >= 40) {
alert("Too much");
} else if(x.length <= 3) {
alert("Too Less");
} else {
//ok;
var value=("BC102034568");
var at=x.indexOf("@");
var dot=x.lastIndexOf("vu.edu.pk");
if (at<1 || dot<at+1 || dot+2>=x.length)
{
alert( x + " is Not your valid VU e-mail address");
}
else
{
if(x=="BC102034568@vu.edu.pk")
{
alert( x + " is your valid VU e-mail address");
return true;
}
else
{
alert( x + " is not an valid email address");
}
}
}
return false;
}
</script>
</head>
<body>
<form name="myForm" action="example.html" onsubmit="return CheckMyEmail();" method="post">
Email: <input type="text" name="email">
<input type="submit" value="Submit">
</form>
</body>
</html>
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
[WordPress] How to do this in javascript/php?
By thizzladen in forum Web Application/Script SupportReplies: 0Last Post: 16th Mar 2012, 12:05 AM -
Partner for making a stream / money making site.
By S?nic in forum Community CooperativeReplies: 21Last Post: 6th Jan 2012, 10:39 PM -
[Hiring] 50 $ for making Javascript addon exactly like this ( latest posts )
By TheTorrentSeller in forum Completed TransactionsReplies: 6Last Post: 1st May 2011, 05:45 PM -
Need Javascript Help
By Netguy in forum Web Development AreaReplies: 7Last Post: 19th Mar 2011, 03:24 PM -
Help About JavaScript
By macypro in forum Technical Help Desk SupportReplies: 1Last Post: 7th Dec 2010, 12:23 AM
themaCreator - create posts from...
Version 3.53 released. Open older version (or...