[jQuery] Re: How to bind validation to new loaded form?

2008-11-25 Thread [EMAIL PROTECTED]

I still dont get it, how to bind my new loaded form.

I have installed live query now, but i am still doing it the wrong
way.

used this to bind:

$(#signupForm).bind(submit, function() { return false; })

I should expect that submitting this form, would be disabled
thenbut no

tried this:

$(#signupForm).bind(submit, function() {
   alert(blah blah);
   return false; }

no result too.

and then i included the LiveQuery plugin:

$(#signupForm).livequery(validateSignUp());


also no result

i have 2 versions of my form, the one immediately loaded and the one
loaded afterwards.
first one validations still works second one still not.

I am a real beginner with javascript and jQuery and am usy for several
days now, so help will really really be appreciated.
if needed, i can sent you the url.


[jQuery] Re: How to bind validation to new loaded form?

2008-11-24 Thread [EMAIL PROTECTED]

hanks for the reply.
I got this anwer on a previous question. (very helpfull, cause a few
days ago i did not know binding  even existed)
So i understand that i have to bind my new form to my validation
script.
But i cant get it working this time.

I have tried to validate just one input for an easier example.
This is wat i made of it:

 $('#nieuwespeler').click(function(){
//alert(Nieuwe speler! howra); Got this alert
var toLoad = 'forms/registratie.php';
  $('#content').hide('slow',loadContent); // fast, slow, normal or
milliseconden??
  $('#load').remove();
  $('#content').append('span id=loadLOADING.../span');
  $('#load').fadeIn('slow');
  function loadContent() {
   $('#content').load(toLoad,'',showNewContent())
  }
  function showNewContent() {
   $('#content').show('slow',hideLoader)
  }

  function hideLoader() {
   $('#load').fadeOut('slow');
  }

$(#signupForm).validate({
 rules:{
  firstname: required,
  username:
{
   required: true,
   minlength: 2}
 }
});



return false;
   });


I have added above code in my document ready part.
The signup form does appear, ut when i submit this form, without
filling in anything, it submits without validation.

My question is: What is wrong with the last part, where i try to bind
the validation to my form?
Validation does work, when including this form directly in the page,
but not when loading afterwards..
Apperently i am binding the wrong way, but just cant see what is wrong
with it.
Please??


[jQuery] Re: How to bind validation to new loaded form?

2008-11-23 Thread Mike Alsup

 Hi all,
 i have tried to transform a bind example to my situation, but i can't
 get it working.
 Via my menu, i load a form which i want to validate.
 ( with Validation plugin 
 fromhttp://bassistance.de/jquery-plugins/jquery-plugin-validation/

 Loading the form into my content div works fine, validation fails.


This may help:

http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_Ajax_request.3F