am doing my first project so plz help
i've created a submit button
[HTML]<input type="submit" onclick="valid( )">[/HTML]
my function valid checks if the fields are not empty if empty a window prmpt appears then when i press ok i move to the next page
for example
[HTML]<script type="text/javascript">
<!--
function valid()
{
var n=document.form .fname.value.le ngth;
if(n==0){
window.alert("e nter ur first name");
return false;
} }
//--></script>
[/HTML]then the php code
[HTML] <input type="submit" name="sub" value="Submit Your Entries" onclick="valid( )" />
[/HTML]i wrote instead of type="submit" =>type="button " it works but when i fill all the fields am not moving to next page
i've created a submit button
[HTML]<input type="submit" onclick="valid( )">[/HTML]
my function valid checks if the fields are not empty if empty a window prmpt appears then when i press ok i move to the next page
for example
[HTML]<script type="text/javascript">
<!--
function valid()
{
var n=document.form .fname.value.le ngth;
if(n==0){
window.alert("e nter ur first name");
return false;
} }
//--></script>
[/HTML]then the php code
[HTML] <input type="submit" name="sub" value="Submit Your Entries" onclick="valid( )" />
[/HTML]i wrote instead of type="submit" =>type="button " it works but when i fill all the fields am not moving to next page
Comment