Dynamically Form Validation-Problem

For Joomla! 1.5 Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general
Locked
Papillon
Joomla! Apprentice
Joomla! Apprentice
Posts: 42
Joined: Thu Aug 18, 2005 2:08 pm
Location: Good old Germany

Dynamically Form Validation-Problem

Post by Papillon » Tue Dec 23, 2008 8:46 am

Hello,

I have a form which can be dynamically expanded with additional email-fields. I do this with Javascript (appendchild). That works fine.
The sole problem is that the form validation don't work completely with the attached fields.

Static field (works):

Code: Select all

<div class="reihe" id="reihe_0">
            <label for="email_0">
                <span class="label"><?php echo JText::_( 'RECIPIENT_EMAIL' ); ?></span>
            </label>
            <span class="feld"><input type="text" class="defbreite required validate-email" maxlength="100" name="email_0" id="email_0" value='' size="30" /></span>
</div>
When I change to another field, the form validation is automatically done.

The Code which is dynamically created with Javascript looks like this:

Code: Select all

<div class="reihe" id="reihe_1">
            <label id="label_1" for="email_1">
                 <span id="span_2" class="label">Empfänger 2:</span>
            </label>
            <span id="span2_1" class="feld"><input type="text" name="email_1" id="email_1" class="defbreite required validate-email" size="30" maxlength="100"/></span>
</div>
In this dynamically created field the validaiton is only done when I click the Submit-Button but not on leaving this field.
If I insert the created code directly into the php-file the code is working.

Any idea for me how to get it working?

Thanks very much
Papi

Locked

Return to “Joomla! 1.5 Coding”