Hi monks,
I am new to cgi programming. I have to validate the form in CGI. How to validate the form using javascript code or cgi code. I use this below code to check in form whether the employee code is entered or not in form. The below mentioned code is not validating. so, any one plz. help for below mentioned code.
Thanks in advance.
#!C:\Perl5.8.4\bin\perl5.8.4.exe use CGI qw(:standard); print header; print start_html(-title=>"hello world", -bgcolor=>"#BOE0E6"); print end_html; print h1("<center>Hello World!</center>"); print qq{<form name="hello" action="firstdb.cgi" method="POST" onsubmi +t="return newsoft();"> Employee Code : <input type="text" name="empcode" size="20"><br>< +br> <input type="submit" value="Submit"> <input type="reset" value="reset"> }; print qq{<SCRIPT TYPE="javascript"> function newsoft() { if(isBlank(document.hello.empcode.value)==true) { alert("Please enter the Software"); document.hello.empcode.focus(); return false; } return true; } </SCRIPT>};
In reply to How to validate the form in CGI by gube
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |