Validation

Shows some Tutorials

Validation

Postby mortenosx on Tue May 27, 2008 5:41 pm

I just dont get it - how do i make my form with validation

My form code is.
Code: Select all
<table>
<tr>
<td width="93">Dit navn:</td>
<td width="255">
<input name="dit_navn" type="text" value="" size="36" maxlength="100" />
</td>
</tr>
<tr>
<td width="93">Din e-mail:</td>
<td width="255">
<input name="din_e-mail" type="text" value="" size="36" maxlength="100" />
</td>
</tr>
<tr>
<td>Besked:</td>
<td>
<textarea name="besked" cols="35" rows="3" id="besked"></textarea>
</td>
</tr>
<tr><td></td>
<td>
{imageverification}
</td>
</tr>
<tr><td> </td>
<td>
<input type="submit" value="Send" />
</td>
</tr>
</table>
mortenosx
Fresh Boarder
 
Posts: 2
Joined: Tue May 27, 2008 5:23 pm

Re:Validation

Postby GreyHead on Tue May 27, 2008 5:47 pm

Hi mortenosx,

Click the validation tab, turn Validation on and put dit_nav-n,din_e-mail in the 'Required' box. Save. Refresh your form and check that it works.

Bob
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3412
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re:Validation

Postby mortenosx on Tue May 27, 2008 6:11 pm

WOW, this works great.

Can you also explain how i get the senders e-mail in the send from... Now it says din_email... when i get a mail from the form.
mortenosx
Fresh Boarder
 
Posts: 2
Joined: Tue May 27, 2008 5:23 pm

Re:Validation

Postby GreyHead on Wed May 28, 2008 6:34 am

Hi mortenosx,

We don't recommend putting the submitter's email in the send from. The email is technically from the website not from the form submitter. Using submitter's email in the Reply To and From fields is a frequent cause of email problems.

It is still possible and you will find several versions in the forums here if you search on ReplyTo.

Bob
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3412
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re:Validation

Postby ladyb314 on Wed Jun 04, 2008 8:07 pm

I don't understand what I am doing wrong, but I even tried making a test form using the exact html code from this thread and adding those field names to the validation required field, and it does not work. I can press send without filling in anything and it still sends.

I am using Joomla 1.5, the very latest Chrono Form component, and i used prototype and mootools, but neither worked.

It sends it to my email successfully though. What could I be doing wrong?
ladyb314
Fresh Boarder
 
Posts: 1
Joined: Wed Jun 04, 2008 7:56 pm

Re:Validation

Postby GreyHead on Thu Jun 05, 2008 5:34 am

Hi ladyb314,

Check that you have validation turned on.

You've already done this so for other readers: Try both JavaScript libraries - prototype and mootools - in turn (mootools is preferred for Joomla 1.5 as it is used by Joomla).



If neither of these work then most likely there is a JavaSCript conflict with something else on your page.

View the page using index2.php in place of index.php (this removes all the other Joomla templating).

If validation now works then use FireBug in Firefox on the index.php page to see what is conflicting.

Bob
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3412
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re:Validation

Postby lennart on Fri Jun 06, 2008 11:26 am

My problem seemed the same as Ladyb314.
Validation is on, tried prototype and mootools.

I thought to be clever and putted form code in a php <?php include 'contactformulier.php'; ?> and included this in Form HTML.

Nice plan, seemed to work, but did not work. Somehow validation doesn't work if u use php include.

Back to plan A: no php include!
lennart
Fresh Boarder
 
Posts: 2
Joined: Thu Jun 05, 2008 9:36 pm

Re:Validation

Postby GreyHead on Fri Jun 06, 2008 12:00 pm

Hi lennart,

No, validation doesn't work if you include your form code.

But there is a simple work-around. Turn validation on in ChronoForms but make no entries in the field boxes.

Then add the class attributes directly into your form HTML, like this
Code: Select all
<input type='text' name='field_name' class='required' . . ./>
This will work OK.

Bob
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3412
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany


Return to ChronoForms How To

Who is online

Users browsing this forum: Google [Bot] and 1 guest