Hi,
I created a simple form in Web Expressions, copied the html to ChronoForms and want to use javascript validation for required fields.
This is what I put in for js:
2. I am also using image verification but there seems to be a problem there, too, as there seems to be no such verifcation:
Thanks. I am an anxious learner.
Edited to add code tags<br><br>Post edited by: GreyHead, at: 2008/04/24 19:26
I created a simple form in Web Expressions, copied the html to ChronoForms and want to use javascript validation for required fields.
This is what I put in for js:
function process_general_form() {
var Email = document.ChronoContact_webkontakt.Email.value;
var Nachname = document.ChronoContact_webkontakt.Nachname.value;
var Vorname = document.ChronoContact_webkontakt.Vorname.value;
var Strasse = document.ChronoContact_webkontakt.Strasse.value;
var Hausnummer = document.ChronoContact_webkontakt.Hausnummer.value;
var PLZ = document.ChronoContact_webkontakt.PLZ.value;
var Stadt = document.ChronoContact_webkontakt.Stadt.value;
var Land = document.ChronoContact_webkontakt.Land.value;
var Interesse = document.ChronoContact_webkontakt.Interesse.value;
var Nachricht = document.ChronoContact_webkontakt.Nachricht.value;
if ((Email == ""«»))
{
alert("Formularfeld nicht ausgefüllt\n\nEinige der Felder sind notwendig."«»);
document.ChronoContact_webkontakt.Email.focus();
} else if ((Nachame == ""«»)){
alert("Formularfeld nicht ausgefüllt\n\nEinige der Felder sind notwendig."«»);
document.ChronoContact_webkontakt.Nachname.focus();
} else if ((Vorname == ""«»)){
alert("Formularfeld nicht ausgefüllt\n\nEinige der Felder sind notwendig."«»);
document.ChronoContact_webkontakt.Vorname.focus();
} else if ((Strasse == ""«»)){
alert("Formularfeld nicht ausgefüllt\n\nEinige der Felder sind notwendig."«»);
document.ChronoContact_webkontakt.Strasse.focus();
} else if ((Hausnummer == ""«»)){
alert("Formularfeld nicht ausgefüllt\n\nEinige der Felder sind notwendig."«»);
document.ChronoContact_webkontakt.Hausnummer.focus();
} else if ((PLZ == ""«»)){
alert("Formularfeld nicht ausgefüllt\n\nEinige der Felder sind notwendig."«»);
document.ChronoContact_webkontakt.PLZ.focus();
} else if ((Stadt == ""«»)){
alert("Formularfeld nicht ausgefüllt\n\nEinige der Felder sind notwendig."«»);
document.ChronoContact_webkontakt.Stadt.focus();
} else if ((Land == ""«»)){
alert("Formularfeld nicht ausgefüllt\n\nEinige der Felder sind notwendig."«»);
document.ChronoContact_webkontakt.Land.focus();
} else if ((Interesse == ""«»)){
alert("Formularfeld nicht ausgefüllt\n\nEinige der Felder sind notwendig."«»);
document.ChronoContact_webkontakt.Interesse.focus();
} else if ((Nachricht == ""«»)){
alert("Formularfeld nicht ausgefüllt\n\nEinige der Felder sind notwendig."«»);
document.ChronoContact_webkontakt.Nachricht.focus();
} else {
document.ChronoContact_webkontakt.submit();
}
}
The form is called Webkontakt. In html, this is the submit line:
<form name="ChronoContact_Webkontakt" id="ChronoContact_Webkontakt" method="post" action="index.php?option=com_chronocontact&task=send&chronoformname=Webkontakt" >
...
<input type="submit" value="Abschicken" onSubmit="process_general_form()" />
<input type="reset" value="Zurücksetzen" />
But there is no validation at all. The email is just being sent, empty, no questions asked. 2. I am also using image verification but there seems to be a problem there, too, as there seems to be no such verifcation:
<tr><td><b>Geben Sie bitte den Code ein:</b></td><td>
<input name="agd_verification" type="text" id="agd_verification" value="">
<img src="http://www.chronoengine.com/components/com_chronocontact/chrono_verification.php?imtype=1">
</td></tr>
Can you please suggest something here?
Thanks. I am an anxious learner.
Edited to add code tags<br><br>Post edited by: GreyHead, at: 2008/04/24 19:26
Hi Zara20,
For the validation, try putting onSubmit="process_general_form()" into the 'Form tag attachment' box on the 'General Tab', ChronoForms will then insert it into the Form tag.
This may also fix the ImageVerification problem as I think that the form is being oddly submitted. If not, please come back and ask again.
Bob
PS Hard to tell from your post - but the code in the Form HTML box should *not* include the form tags.
For the validation, try putting onSubmit="process_general_form()" into the 'Form tag attachment' box on the 'General Tab', ChronoForms will then insert it into the Form tag.
This may also fix the ImageVerification problem as I think that the form is being oddly submitted. If not, please come back and ask again.
Bob
PS Hard to tell from your post - but the code in the Form HTML box should *not* include the form tags.
This topic is locked and no more replies can be posted.