i have created a web page and placed some text boxes on it, now i'm looking to create an error massages when a person enter a wrong input the error massage will tell him/her to enter the right one and also if he/she left a text field empty and clicked a button, an error msj will inform the user that there's an empty field .
monta2020
0
Newbie Poster
Recommended Answers
Jump to Postalert and back to referrer:
echo "<script>alert(\"Username not found.\")</script>"; die("<script type=\"text/javascript\">window.history.back();</script>");
Jump to PostCheck this code.
And implement as per your need.<script language="javascript"> function valid(form) { if(form.name.value=="") { alert('Please enter name'); return false; } else if(form.subject.value=="") { alert('Please enter subject'); return false; } else { return true; } } </script> <form name="frm" id="frm" method="post" onsubmit="return valid(this);"> <br />Name : …
All 5 Replies
phpbeginners
1
Posting Whiz in Training
vibhaJ
126
Master Poster
monta2020
commented:
THIS HELLLLLPED ME !!!
+0
perfectweb
0
Newbie Poster
monta2020
0
Newbie Poster
phpbeginners
1
Posting Whiz in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.