Forums

LiveValidation custom OnBlur

Duoas 15 Jul, 2009
Hello all. I am about two-days old using ChronoForms... and I've been having a very tough time getting a custom validation to work.

I want it to trigger only on OnBlur events (just like all the other 'standard' validations), but it runs only while the user is typing.

The item in question is simply this

<div class="form_item">
  <div class="tooltipimg" style="width: 16px"></div>
  <div class="form_element cf_textbox m_left_margin">
    <label class="cf_label" style="width: 150px;" for="full_name">First and Last Name</label>
    <input class="cf_inputbox required m_input_box" maxlength="150" size="30" title="" id="full_name" name="full_name" type="text" />
  </div>
  <div class="cfclear"> </div>
</div>
I have the tooltips aligned out in front of items on the left... (hence line 2).

The CSS for that odd tag is simply

.m_input_box {
  width:            300px;
  background-color: white;
  }


The Form JavaScript I am using

window.addEvent(
  'domready',
  function()
    {
    var full_name = new LiveValidation( 'full_name' );
    full_name.add(
      Validate.Format,
      {
        pattern:        /^\S+\s+.*\S+$/i,
        failureMessage: "Please enter both first and last names."
      }
      );
    full_name.onlyOnBlur   = true;
    full_name.onlyOnSubmit = false;
    }
  );


JavaScript Live Validation settings:
[list]
  • Enable Validation = Yes

  • Validation Library = mootools

  • Run Validation onlyOnBlur = Yes

  • Waiting time =

  • Run Validation onlyOnSubmit = No
  • [/list]
    and my 'full_name' form input box is also listed for a required (not blank) validation.

    Joomla 1.5.10
    ChronoForms V3.1 RC5.3
    Caching is turned OFF

    I have searched around a bit, but my newbieness has missed me something important, methinks.
    I found this thread http://www.chronoengine.com/forums/index.php?option=com_chronoforums&cont=posts&f=2&t=14922&p=35611&hilit=livevalidation+onlyonblur#p35611 which mentions the same problem, but I am using RC5.3...

    It would be nice to be able to simply verify that the user entered two distinct names...
    But I suppose I could just add another input box to my form instead...

    Could anyone point me in the right direction?

    --Duoas
    Max_admin 15 Jul, 2009
    Hi Duoas,

    do you mean that the onlyOnBlur is not working for you with your custom validation fields only ? if so then please check that your have the onlyOnBlur options placed in the correct position ? it looks like they they should be in the Livevalidation instance, not sure, just double check and let me know!

    another thought, if you will add custom validation for a field then don't rely on any validation set at the validation tab for this field, make a complete new one for the field with all settings!

    Regards,
    Max
    Max
    ChronoForms developer...
    Did you try ChronoMyAdmin for managing your Joomla database tables ?
    This topic is locked and no more replies can be posted.