konqueror & javascript problem

FyD fyd at u-picardie.fr
Fri Jun 24 20:40:06 BST 2005


Dear All,

I wrote the HTML/Javascript page which is below: I want the three sections
SECTION1, SECTION2 & SECTION3 to be independent.

This means:
- If the user click on the "Register" button of "SECTION1" it must have provided
before his first & lastname otherwise Javascript "Warnings-1" will show up...
- Same idea with SECTION3 where "Warnings-3" will show up in case of missing
information...
- However, the Javascript "Warnings-1" popups should show up _only_ when the
user fill the SECTION1 and NOT for the SECTION3

The script below works fine with mozilla or IE, but not with konqueror 3.2.2
where the "Warnings-1" show up _even_ if the user use the SECTION3...

Could you someone help me to solve this problem ?

Thanks, regards, Francois


<html>
<head><script language="javascript">
function formul3()
{
	if(document.form3.login2.value == "")
	{
		alert("Warning3: LOGIN");
		document.form3.login2.focus();
   		return false;
	}
	if(document.form3.mdp2.value == "")
	{
		alert("Warning3: PASSWORD");
		document.form3.mdp2.focus();
   		return false;
	}
}
function formul1()
{
	if(document.form.firstname.value == "")
	{
		alert("Warning1: FIRSTNAME");
		document.form.firstname.focus();
   		return false;
	}
	if(document.form.lastname.value == "")
	{
		alert("Warning1: LASTNAME");
		document.form.lastname.focus();
   		return false;
	}
}
</script></head><body>

SECTION1<br>
<form name="form" method="post" action="register2.php"
onSubmit="return formul1()">
  <table border=1>
    <tr><td>Firstname</td><td><input type="text" name="firstname"
size=20></td></tr>
    <tr><td>Lastname</td><td><input type="text" name="lastname"
size=20></td></tr>
  </table><br>
  <input type="submit"  value="Register">
</form>

SECTION2<br>
<form name="form2" method="post">
  <input type="text" name="femail" size=20>
  <input type="submit" name="ok" value="OK"><br>
</form>

SECTION3<br>
<form name="form3" method="post" action ="verif2.php"
onSubmit="return formul3()">
  login<input type="text" name="login2" size = 20>
  password<input type="password" name="mdp2">
  <input type="submit" name="btvalider" value="OK">
</form>
</body></html>





More information about the kfm-devel mailing list