php en JavaScript Onclick
timmy
09/06/2005 21:56:00door de Javascript
OnClick wordt de php foutmelding ($err_name) niet weergegeven...
Ziet iemand wat de oorzaak is?
<form action="./test.php" method="post" name="next2">
name: <input type="text" name="name" value="">
<input type="submit" name="Xenter" value="verder" onClick="document.next2.Xenter.value=('Even geduld aub...'); document.next2.Xenter.disabled=true;document.next2.submit();">
</form>
groet
Tim
OnClick wordt de php foutmelding ($err_name) niet weergegeven...
Ziet iemand wat de oorzaak is?
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?
function check_len(&$check, $field, $max, &$err_field, $err="", $min, $min_err="")
{
if (strlen($field) > $max)
{
if ($err == "")
{
$err = $msg->err_maxlen($max);
}
$err_field = $err;
if ($check==true) $check = false;
}
if (strlen($field) < $min)
{
if ($min_err == "")
{
$min_err = $msg->err_minlen($min);
}
$err_field = $min_err;
if ($check==true) $check = false;
}
}
$checked = true;
if (isset($HTTP_POST_VARS["Xenter"]))
{
check_len($checked, $HTTP_POST_VARS["name"],100,$err_name,"Field too long! Maximum:100",3,"Field required! Minimum:3");
}
if ( empty($HTTP_POST_VARS["Xenter"]) or (!$checked) )
{
echo "<li> $err_name";
}
?>
function check_len(&$check, $field, $max, &$err_field, $err="", $min, $min_err="")
{
if (strlen($field) > $max)
{
if ($err == "")
{
$err = $msg->err_maxlen($max);
}
$err_field = $err;
if ($check==true) $check = false;
}
if (strlen($field) < $min)
{
if ($min_err == "")
{
$min_err = $msg->err_minlen($min);
}
$err_field = $min_err;
if ($check==true) $check = false;
}
}
$checked = true;
if (isset($HTTP_POST_VARS["Xenter"]))
{
check_len($checked, $HTTP_POST_VARS["name"],100,$err_name,"Field too long! Maximum:100",3,"Field required! Minimum:3");
}
if ( empty($HTTP_POST_VARS["Xenter"]) or (!$checked) )
{
echo "<li> $err_name";
}
?>
<form action="./test.php" method="post" name="next2">
name: <input type="text" name="name" value="">
<input type="submit" name="Xenter" value="verder" onClick="document.next2.Xenter.value=('Even geduld aub...'); document.next2.Xenter.disabled=true;document.next2.submit();">
</form>
groet
Tim
PHP hulp
18/11/2024 03:33:52- SanThe -
09/06/2005 22:11:00if ( empty($HTTP_POST_VARS["Xenter"]) or (!$checked) )
{
echo "<li> $err_name";
}
Geef daar eens een else achter en kijk of je dan output krijgt. Dus
if ( empty($HTTP_POST_VARS["Xenter"]) or (!$checked) )
{
echo "<li> $err_name";
} else {
echo "Okee";
}
{
echo "<li> $err_name";
}
Geef daar eens een else achter en kijk of je dan output krijgt. Dus
if ( empty($HTTP_POST_VARS["Xenter"]) or (!$checked) )
{
echo "<li> $err_name";
} else {
echo "Okee";
}