Hello!
I want to make a very simple form field validation (only one field) with javascript, but it doesnt work. Please help me!
I have put this to the Form tag attachment box:
and the following to the Form JavaScript:
I want to make a very simple form field validation (only one field) with javascript, but it doesnt work. Please help me!
I have put this to the Form tag attachment box:
onsubmit="return checkform(this);"
and the following to the Form JavaScript:
function checkform (formname)
{
// ** START **
if (document.formname.fieldname.value == ""«») {
alert( "Please fill this field!" );
document.formname.fieldname.focus();
return false ;
}
// ** END **
return true ;
}
Can u show me ur form ?
i cant see this javascript code in the page source!!!!!
Sorry, please check it again, here.
The name of the form is IV._C.A.C._ADA_PRIJAVA.
The field that I want to validate is called rasa, this is the first text input field on the top.
Thank you very much for your help!
The name of the form is IV._C.A.C._ADA_PRIJAVA.
The field that I want to validate is called rasa, this is the first text input field on the top.
Thank you very much for your help!
Hi,
Yes, It wont work because the form name is : ChronoContact_IV._C.A.C._ADA_PRIJAVA
and not IV._C.A.C._ADA_PRIJAVA , sorry but this happens automatically
I suggest using getElementById too!
Cheers
Max
Yes, It wont work because the form name is : ChronoContact_IV._C.A.C._ADA_PRIJAVA
and not IV._C.A.C._ADA_PRIJAVA , sorry but this happens automatically
I suggest using getElementById too!
Cheers
Max
Thank you very much for your help. Following your suggestions and removing all dots from formname finally it works!
Great!🙂 If you have any moment to rate my extension at the extensions.joomla.org then this will be a great favor, because other competitors had given me bad ratings to go to the top😟
Thanks!
Max
Thanks!
Max
Thank you!
This topic is locked and no more replies can be posted.