[jQuery] Re: JQuery Form Plugin

2009-05-20 Thread Dez

Doh!

Of course as soon as I post that something occurs to me that hadn't
before. During a testing cycle a script tag for jquery was added to
the output from the form. I guess that reinitializes everything, which
makes sense. Pulled the tag from the output and everything is fine
again.

-Sean


[jQuery] JQuery Form Plugin

2009-05-20 Thread Dez

I've been using the Form plugin for a while a just recently (within
the last week) something has gummed up the works and I'm not sure
what. Here is my code.

$().ready( function(){
$('#productListForm').ajaxForm({
target: '#toolList',
error: function(request, textStatus, errorThrown){
$("#toolList").html( request.responseText );
}
 });

$('.oep_search').autocomplete('consolidator/fetch_oep.asp', {
width: 250,
minChars: 2,
cacheLength: 1
});

$(".oep_search").result(function(event, data, formatted) {
if (data){
table = $(this).parents("table");
table.find('input[name=oepid]').val( data[1] );
sel = table.find('.lruSelector');
sel.show();
$.ajax({type: "POST",
url: "consolidator/fetch_lru.asp",
data: { id: data[1] },
success: function(data){
sel.html( data );
$("#toolList").html( ajaxloader );
$("#productListForm").submit();  // this call
works
   },
   error: function(request, textStatus, errorThrown){
   sel.html( request.responseText );
   }
   });
}
});

});

function fetchTools(){
 $("#toolList").html( ajaxloader );
 $("#productListForm").submit(); // this call does not
}


The ajax call in $('#oep_search').result() (from an autocomplete
plugin) adds some checkboxes to the form. Each checkbox has an
onclick="fetchTools()" on it. The first call to submit the form in the
ajax success function works. It doesn't change the page and populates
the output div like it should. However, any subsequent attempts to
submit the form don't work. There are two possible ways to trigger a
submit. Either clicking on a checkbox or triggering the autocomplete
result function again. Neither works the second time around. The form
is submitted the old fashioned way and I'm taken away from the page.

This used to work like a champ. I have no idea what has changed. I
haven't been mucking about with the javascript code. No need. I was
using jquery 1.2.6 and form plugin 2.17. I updated to 1.3.2 and 2.18
respectively, but that did not help. This happens both in Firefox and
IE.

Does this ring bells for anyone? Can someone give me some ideas on
what I should be looking for?

-Sean


[jQuery] [validate] Multiplying error messages

2008-12-07 Thread Dez

This is my first time trying to use the validate script. It looks
great, but something is wrong with my set up. I basically tried
copying the functionality of the simple demo.




$(document).ready( function(){
$('#regForm').validate();
});

Register



First 
Name:*



Last 
Name:*



Email:*








It validates when I hit the send button, and displays error messages
like I would expect. However, there are a couple of problems.

1. It only validates when I hit the submit button. If I go back and
try to fix the mistakes, they don't revalidate until I hit submit
again.
2. If I leave something blank or there is some other error, the
original error message doesn't go away. So for my email address, if I
put in an invalid email address after having left it blank on the
first go-round the error messages will stack up "Please enter a valid
email addres.This field is required."

It seems pretty straightforward, but obviously I'm doing something
wrong. Can someone offer a bit of guidance?

-Sean