LiveValidation Error after Submitting

jpark@canarylabs.com 10 Mar, 2010
I have a form which has 2 fields that must be the same. In the Validation tab, under 13-Validation Confirmation I have the two fields listed: email=email_confirmation

In my form, I do not have a redirect URL, but just some simple PHP code that runs in the On Submit Code - After sending email section.

When I submit my form, the next page that displays gets an error.


Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; OfficeLiveConnector.1.4; OfficeLivePatch.1.3; eMusic DLM/4)
Timestamp: Wed, 10 Mar 2010 16:34:48 UTC


Message: LiveValidation::initialize - No element with reference or id of '' exists!
Line: 81
Char: 24
Code: 0
URI: components/com_chronocontact/js/livevalidation_standalone.js


Message: Object doesn't support this property or method
Line: 59
Char: 102
Code: 0
URI: media/system/js/mootools.js



Now if I remove the 13-Validate Confirmation fields, then I do not get this error message. It appears to me that having this validation is causing some javascript code to be inserted into my page that is shown after the submit. This javascript then gets an error because this page does not have those form fields on it. In case it matters, the URL of this page has a "task=beforeshow" in it.

Question: Is there some other place that I should be putting code that I want to generate a page after my form is submitted? What I really am trying to do is take the form contents, call a webservice and display the results.

Jim
GreyHead 10 Mar, 2010
Hi [email]jpark@canarylabs.com[/email],

I think that you probably have an input in your form that has a validation class but has either no id attribute or an id='' attribute. That would best explain this message.

Bob
jpark@canarylabs.com 10 Mar, 2010
Hi Bob,

I checked all of my inputs in my form and I don't think I have one without an ID attribute. I did more testing and removed all but the two email input fields.

Here's my form code:

<div class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label" style="width: 150px;">Email Address</label>
<input class="cf_inputbox validate-email" maxlength="150" size="40" title="Enter your email address." id="email" name="email" type="text" />

</div>
<div class="cfclear"> </div>
</div>

<div class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label" style="width: 150px;">Retype Email</label>
<input class="cf_inputbox validate-email" maxlength="150" size="40" title="Retype your email address." id="email_confirmation" name="email_confirmation" type="text" />

</div>
<div class="cfclear"> </div>
</div>

<div class="form_item">
<div class="form_element cf_button" style="padding-left:160px">
<input value=" Continue" name="button_10" type="submit" />
</div>
<div class="cfclear"> </div>
</div>


One other thing that I noticed. I only get this problem if I use the Confirmation plugin. It happens when I press the final submit button from the confirmation screen. If I skip the confirmation then I do not get an error.


Jim
GreyHead 10 Mar, 2010
Hi Jim,

There are several oddities with the confirmation plugin :-( it's overdue for a re-work.

If you have a moment, please try adding an id='submit' to the submit button input. Every thing else looks fine to me.

Bob
jpark@canarylabs.com 10 Mar, 2010
Hi Bob,

I tried adding an id="submit" to the submit button. It didn't change anything. I still get the error like before.

I worked around this problem by having my own javascript validation routine check to make sure that the two fields match, instead of using the Validation built into the form.

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