different messages for e-mail check

mac 28 Feb, 2009
Hi,
this code in my registration-form, send one message (Bitte geben Sie...) if there are no input or the wrong input.
<div  class="form_item"><div class="form_element cf_textbox"><label class="cf_label">E-Mail*</label><input class="cf_inputbox required" maxlength="150" size="30" id="text_3" name="text_3" title="Bitte geben Sie Ihre E-Mail Adresse ein. "type="text"></div>
<div class="clear"> </div></div>


I want to messages for the different things (greyhead give me a code for my other form - thanks a lot).
Now I want to integrate this code in my registration form - but I am not good in coding 😟
What ist wrong at this code?

<div  class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label">E-Mail*</label>
<input class="cf_inputbox" maxlength="150" size="30" 
id="text_3" name="text_3" "type="text">
</div>
<div style='display:none;color:#ed6e00;' id='advice-required-email'>Dies ist ein Pflichtfeld</div>
<div style='display:none;color:#ed6e00;' id='advice-validate-email-email'>Bitte geben Sie Ihre vollstÀndige E-Mail Adresse ein.</div>
<div class="clear"> </div>
</div>

this is the result.
http://www.formfalt.net/email.gif
Regards
Mac
Max_admin 28 Feb, 2009
Hi mac,

I see the same code but the 2nd one is formatted and have 2 useless lines, so simply replace the bottom code with the top one!

Cheers
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
mac 01 Mar, 2009
Hi,
this code in another form works right.
<input maxlength="60" size="40" id='email' name="EMAIL" class="standard validate-email required" />
<div style='display:none;color:#ed6e00;' id='advice-required-email'>Dies ist ein Pflichtfeld</div>
<div style='display:none;color:#ed6e00;' id='advice-validate-email-email'>Bitte geben Sie Ihre vollstÀndige E-Mail Adresse ein.</div>

I want the english message translate to german
http://www.formfalt.net/emailmessages.jpg

Regards
Mac
GreyHead 01 Mar, 2009
Hi mac,

No . . . ignore Max (just this once) - the two 'useless' lines are the ones that give you the messages you need.

You have a misplaced " in here
title="Bitte geben Sie Ihre E-Mail Adresse ein. "type="text">
that shound be . . .ein." text=" . . .

And you need to change the id of the mesage fields to match the name of the field you are trying to validate like this id='advice-required-text_3'

Make both changes and try
<div  class="form_item">
  <div class="form_element cf_textbox">
    <label class="cf_label">E-Mail*</label>
    <input class="cf_inputbox required" maxlength="150" size="30" id="text_3" name="text_3" type="text"></div>
  </div>
  <div style='display:none;color:#ed6e00;' id='advice-required-text_3'>Dies ist ein Pflichtfeld</div>
  <div style='display:none;color:#ed6e00;' id='advice-validate-email-text_3>Bitte geben Sie Ihre vollstÀndige E-Mail Adresse ein.</div>
  <div class="clear"> </div>
</div>

Bob
mac 01 Mar, 2009
Hi Bob,
thanks!
finally it works - I tried thousand times :wink: I think there was a cache problem.

How can I integrate the class
.validation-advice
in this code?
<div style='display:none;color:#ed6e00;' id='advice-validate-email-text_3'>Bitte geben Sie Ihre vollstÀndige E-Mail Adresse ein.</div>
I doen't find the solution đŸ˜¶
Regards
Mac

[attachment=0]emailcode.jpg[/attachment]
GreyHead 01 Mar, 2009
Hi mac,

You can just add the script in the Form HTML, or more elegantly:
<?php
$doc = & JFactory::getDocument();
$doc->addScriptDeclaration(".validation-advice {
  color:red; 
  font-weight:bold;
}");

Bob
mac 01 Mar, 2009
Hi Bob,
when I put this code
<div style='display:none;color:#ed6e00;' class='validation-advice' id='advice-required-text_3'>Dies ist ein Pflichtfeld!</div>

in the html code field, or your php instruction in the 'Server Side Validation Code'
both doesn't work. Is my way wrong?
Regards
Mac
GreyHead 01 Mar, 2009
Hi mac,

Sorry, I don't understand what you are doing or what your question is.

Bob
mac 01 Mar, 2009
Hi Bob,
I want that the error message 'Dies ist ein Pflichtfeld' appears in the same style as 'Bitte geben Sie Ihren Firmenname an' how is shown in the 'title' tag.
This title tag has the class .validation-advice.
I did not now how I must combine in the existing code. I tried it so:
<div style='display:none;color:#ed6e00;' class='validation-advice' id='advice-required-text_3'>Dies ist ein Pflichtfeld!</div>

but this is wrong.
You give me a better solution, and I put your code in the field 'Server Side Validation Code', I thought that is the correct position!?

Mac
GreyHead 02 Mar, 2009
Hi Mac,

I don't think that any of this code is using Server-side validation. There seem to be both styling and layout problems here. Please post all the code from the Form HTML box so I can take a look.

Bob
Max_admin 02 Mar, 2009
Hi Bob,

Sorry but I'm not following here, is this code below is used to show different error messages when the required error event triggers or the valid email error triggers ?

<div style='display:none;color:#ed6e00;' id='advice-required-text_3'>Dies ist ein Pflichtfeld</div>
  <div style='display:none;color:#ed6e00;' id='advice-validate-email-text_3>Bitte geben Sie Ihre vollstÀndige E-Mail Adresse ein.</div>


Thanks!

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
GreyHead 02 Mar, 2009
Hi Max,

This is a little feature of the MooValidation that lets you create custom warning messages that can be put anywhere on the page.

The first one id='advice-required-text_3' will display if the input with id='text_3' fails the 'required' test.

The second one id='advice-validate-email-text_3' will display if the input with id='text_3' fails the 'validate-email' test.

You can do this with any input and any validation - the structure is id='advice-{validation_type}-{input_id}'

Bob
Max_admin 02 Mar, 2009
Hi Bob,

Thank you! got it!😀

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
mac 03 Mar, 2009
Hi,
...just now, as I want to post the whole code - I found one '</div>' too much - and that was my mistake đŸ˜¶

Thank you all for your help!!
Regards
Mac
GreyHead 03 Mar, 2009
Hi mac,

No problem - it happens to all of us :-)

Bob
This topic is locked and no more replies can be posted.