need help for simple javascript validation

hgeorge 15 May, 2007
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:
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 ;
}
Max_admin 16 May, 2007
Can u show me ur form ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Max_admin 16 May, 2007
i cant see this javascript code in the page source!!!!!
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
hgeorge 16 May, 2007
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!
Max_admin 21 May, 2007
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
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
hgeorge 23 May, 2007
Thank you very much for your help. Following your suggestions and removing all dots from formname finally it works!
Max_admin 23 May, 2007
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
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
hgeorge 23 May, 2007
Now chronoforms is on the first place!;)
Max_admin 23 May, 2007
Thank you!
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.