
June 6th, 2000, 06:31 AM
|
 |
Contributing User
|
|
Join Date: Feb 2000
Location: Perth West Australia
Posts: 757
Time spent in forums: 4 h 18 m 32 sec
Reputation Power: 14
|
|
|
But if you use javascript it is faster because you do not have to refresh the page.
function valid(){
if(document.cfone.Cname.value=="") {alert("empty field");return false;}
}
would be used with
<form onsubmit="return cvalid()" name="cfone" action=.....etc>
<input type=text name=Cname></form>
or if you are using divs & netscape you can chuck in a bit of PHP snifing - cos this is the PHP section innit'.
if(<?php if(!ereg( "MSIE", $HTTP_USER_AGENT)){ echo "document.NAMEofDIV.";}?>document.cfone.Cname.value=="") {alert("Please enter your name");return false;}
(adds the path to the div for netscape as it has dodgy eyesight)
Simon
------------------
Simon Wheeler
FirePages -DHTML/PHP/MySQL
|