Click here to Skip to main content
15,885,767 members
Home / Discussions / JavaScript
   

JavaScript

 
GeneralRe: HTML5 Javascript Issue Pin
#realJSOP4-Dec-12 1:06
mve#realJSOP4-Dec-12 1:06 
GeneralRe: HTML5 Javascript Issue Pin
#realJSOP4-Dec-12 7:31
mve#realJSOP4-Dec-12 7:31 
GeneralRe: HTML5 Javascript Issue Pin
Zaf Khan19-Dec-12 20:36
Zaf Khan19-Dec-12 20:36 
AnswerRe: HTML5 Javascript Issue Pin
Zaf Khan19-Dec-12 20:42
Zaf Khan19-Dec-12 20:42 
QuestionCatching Exceptions in Javascript Pin
Ved Yo29-Nov-12 14:43
Ved Yo29-Nov-12 14:43 
QuestionPartial Overlay to cover ajax request Pin
Sentenryu29-Nov-12 1:51
Sentenryu29-Nov-12 1:51 
QuestionHow to get value from TD Pin
Chitttapa26-Nov-12 10:03
Chitttapa26-Nov-12 10:03 
Questionhelp me please Pin
nth9224-Nov-12 4:16
nth9224-Nov-12 4:16 
please help me to write ...

A) Write the code for the login.html document (Client side) which gives the following interface. When the user clicks on the button you must check if the user enters data or not, if the fields are empty you must present an alert message and do not send the data to the server side. If the user entered login and password, then your program must call the validate.php document.



B) Write the code of the server side validate.php page such that.
1) The validate.php checks if the login is valid or not. A valid login must
start with a letter and followed by any one or more of the characters:_, 0-9, A-Z, a-z
For instance, a1, ab_1, and Z_2d are valid logins while _a1, b*, and
c23_@2 are invalid logins. But, there are no restrictions on the password; the user
can use any character in the keyboard. (hint. You must use the regular expression
in php).


2) The validate.php page reads the login and passwords from a database
named"students" to verify whether the student is a valid user. The "students"
database contains two tables named "login_pssword" and “marks”. The
login_pssword table has three fields “Student_Id”,"login" and"password”.
Check if the user name and passwords exist. If it exists print the message
"Thank you for logging in". If the password or login is not in the database,
display the alert message "wrongpassword and/or login please try again".
The “marks” table has five fields: student_Id, course_name, first_mark,
second_mark, Final_mark.

3)if a valid user logged in, give him/her two choices:

1. Add a new student
2. Remove a student

Design two different forms, one for each choice above to enable the student to perform the choice he/she selected.


the header code :-

XML
<html> <head> <script type = "text/javascript">
Function validate(){
     Winow.event.returnvalue = false;
     If ((f1.login.value == "") || (f1.password.value ==""))
                     alert("you must enter your name and password");
     else
             window.event.returnvalue = true;
         }
</script> </head> <body>
<form  id ="f1"  action = "validate.php"   method = "post" onsubmit ="validate()">
User Name <input  type ="text"  name = "login"/> <br />
Password <input  type ="password" name ="password"/> <br />
<input type = "submit"  value ="login"/>
</form> </body> </html>

AnswerRe: help me please Pin
Leon Munir25-Nov-12 13:46
Leon Munir25-Nov-12 13:46 
GeneralRe: help me please Pin
J4amieC25-Nov-12 21:13
J4amieC25-Nov-12 21:13 
GeneralRe: help me please Pin
Leon Munir26-Nov-12 2:06
Leon Munir26-Nov-12 2:06 
GeneralRe: help me please Pin
J4amieC26-Nov-12 5:30
J4amieC26-Nov-12 5:30 
GeneralRe: help me please Pin
fjdiewornncalwe26-Nov-12 5:37
professionalfjdiewornncalwe26-Nov-12 5:37 
GeneralRe: help me please Pin
nth9226-Nov-12 9:28
nth9226-Nov-12 9:28 
Questiononmouseover and document.getElementById Pin
SRJ9223-Nov-12 4:18
SRJ9223-Nov-12 4:18 
AnswerRe: onmouseover and document.getElementById Pin
J4amieC23-Nov-12 4:48
J4amieC23-Nov-12 4:48 
GeneralRe: onmouseover and document.getElementById Pin
SRJ9223-Nov-12 5:49
SRJ9223-Nov-12 5:49 
AnswerRe: onmouseover and document.getElementById Pin
sachin_jain30-Nov-12 9:17
sachin_jain30-Nov-12 9:17 
Questiondisplaying different contentunder single layout Pin
radha123 from Hyderabad23-Nov-12 3:32
radha123 from Hyderabad23-Nov-12 3:32 
AnswerRe: displaying different contentunder single layout Pin
manojwadnere28-Dec-12 0:07
manojwadnere28-Dec-12 0:07 
QuestionRegular expression Pin
Member 962181822-Nov-12 2:25
Member 962181822-Nov-12 2:25 
AnswerRe: Regular expression Pin
n.podbielski22-Nov-12 20:00
n.podbielski22-Nov-12 20:00 
GeneralRe: Regular expression Pin
Manfred Rudolf Bihy22-Nov-12 21:20
professionalManfred Rudolf Bihy22-Nov-12 21:20 
GeneralRe: Regular expression Pin
n.podbielski23-Nov-12 21:15
n.podbielski23-Nov-12 21:15 
Questionform validation Pin
therainking7821-Nov-12 22:07
therainking7821-Nov-12 22:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.