[Phplib-users] How to validate a oohform with js ?
Brought to you by:
nhruby,
richardarcher
|
From: Benjamin H. <ho...@eu...> - 2002-10-30 15:24:38
|
How can i validate if either one or the other of two textfields (or both)
is being fillied with some sort of text ?
normally i would use js with a script like this:
<SCRIPT>
function validate()
{
if (document.form.input1.value=="" && document.form.input2.value=="")
{
alert ("please insert some text in one of the input fields");
}
else
{
document.form.submit();
}
}
</SCRIPT>
and use this function on a link
<a href="javascript:Validate();">submit</a>
but how can i do that with phplib, with oohforms and templates ?
i couly only validate both fields if they are empty, but what if only one must be entered with text ?
best regards Benjamin
|