[jQuery] Re: Form values getting unsynchronized after ajaxsubmit [validate]

2009-07-27 Thread Anoop kumar V
Thanks so much for the response - I was doubtful if my posts were even
making it into this list...

Yes - it is clear to me that there is a wierd and unknown issue with the
ajaxsubmit and I am trying other options - the $.ajax and the $.get/$.post.

I will try to debug a bit more if I can pinpoint the issue - otherwise I
will just open an issue and hope the people more familiar with the form
plugin take notice and resolve it.

Thanks again,
Anoop


On Mon, Jul 27, 2009 at 12:12 PM, jackmcleod wrote:

>
> I had 1 problem with ajaxSubmit and switched to using $.post and it
> solved my problems, maybe it can be an alternative for you
>
> On 26 juil, 01:49, anoop  wrote:
> > After several attempts, I have been able to consistently reproduce
> > this problem. It appears that this is an issue with the ajaxSubmit in
> > the form plugin and only in firefox (latest version), IE 7 does not
> > seem to have this issue.
> >
> > The issue occurs in firefox only; when a page with multiple forms is
> > refreshed (by hitting F5 or ctrl-r) the body of the form and the form
> > header get unsynchronized. But after clicking on the reset button for
> > each form it gets rectified.
> > On IE 7 the refresh did not cause any issue anytime.
> >
> > I tried after removing the ajaxSubmit and the problem did not occur in
> > firefox or IE.
> >
> > I have these lines which I think is the cause of the problem:
> >
> > submitHandler: function(form) {
> > $(form).ajaxSubmit({
> >   target: 'body',
> >   error: function (xhr) {
> > $('.derror').text("Errors: Please fix " +
> > xhr.statustext).show("fast");
> > }
> >
> > It could be that I am doing something wrong, but that does not explain
> > the inconsistent behavior between the 2 browsers. It was this block of
> > text that I had to remove to make my forms work even after a refresh.
> >
> > Thanks,
> > Anoop
> >
> > On Jul 24, 11:01 am, Anoop kumar V  wrote:
> >
> >
> >
> > > Attached an html - that shows my situation...
> >
> > > In the page - clicking on any region opens the pop-up form, and once in
> a
> > > while after you submit the pop-ups are mixed up, you see Newyork
> details for
> > > the Washington tab etc. But as soon as I click on the reset button, it
> > > rectifies itself...
> >
> > > Can somebody please help a bit? I am not able to understand / explain
> why
> > > this happens - I do not have a lot of javascript / jquery code, just
> the 2
> > > functions...
> >
> > > Should I call reset for all forms after I submit? If so can someone
> please
> > > show / hint at how that can be achieved?
> >
> > > Thanks,
> > > Anoop
> >
> > > On Fri, Jul 24, 2009 at 2:09 AM, Anoop kumar V  >wrote:
> >
> > > > Hi All,
> >
> > > > I have a very weird issue that I have been trying to resolve for over
> a
> > > > week now with no success in sight.
> >
> > > > I use jsp to generate a page of regional information. The regions are
> > > > displayed as clickable blocks. On clicking each block a pop-up form
> opens up
> > > > with the corresponding region details like id, name and acronym.
> These can
> > > > be edited and submitted as updates. There is also a last block that
> allows
> > > > to create a new region which on clicking opens the same kind of form
> as the
> > > > others, except all the fields are blank and required.
> >
> > > > I am using jquery validator plugin (bassistance) to ensure that the
> user
> > > > does not leave any field blank and I also use the form plugin to do
> an
> > > > ajaxsubmit, so that the id enterred is not a duplicate id.
> >
> > > > On submitting the new region form, a new region gets created and
> updates
> > > > the page fine, but intermittently when I click on the other existing
> blocks
> > > > the information shown in the pop-up is for a completely different
> region:
> > > > for example when I click on a block labelled Washington, the popup
> that
> > > > comes up shows New York, NY, 02. On clicking New York block, the same
> > > > (correct) information is show. This does not happen always and I have
> > > > noticed it happening only in firefox, I use firefox more often also.
> Also if
> > > > I take out the ajaxsubmit and do a simple form submit, it seems to
> not
> > > > occur, but I need the ajaxsubmit for the id validation..
> > > > Interestingly, when I click on the reset button on the individual
> form, the
> > > > values in the fields correct themselves automagically for that form..
> >
> > > > I also used firebug, and when I mouseover the field in the firebug
> console,
> > > > the values in the fields are shown correct (in forebug), except the
> page
> > > > displays the incorrect info. I think this safely eliminates my java
> code as
> > > > the culprit... Again - when I reset the particular form, the values
> are
> > > > good, but only for that form, so if I want to clean all such
> incorrect data,
> > > > I will have to open each form pop-up on the page and click 

[jQuery] Re: Form values getting unsynchronized after ajaxsubmit [validate]

2009-07-27 Thread jackmcleod

I had 1 problem with ajaxSubmit and switched to using $.post and it
solved my problems, maybe it can be an alternative for you

On 26 juil, 01:49, anoop  wrote:
> After several attempts, I have been able to consistently reproduce
> this problem. It appears that this is an issue with the ajaxSubmit in
> the form plugin and only in firefox (latest version), IE 7 does not
> seem to have this issue.
>
> The issue occurs in firefox only; when a page with multiple forms is
> refreshed (by hitting F5 or ctrl-r) the body of the form and the form
> header get unsynchronized. But after clicking on the reset button for
> each form it gets rectified.
> On IE 7 the refresh did not cause any issue anytime.
>
> I tried after removing the ajaxSubmit and the problem did not occur in
> firefox or IE.
>
> I have these lines which I think is the cause of the problem:
>
>         submitHandler: function(form) {
>             $(form).ajaxSubmit({
>               target: 'body',
>               error: function (xhr) {
>                 $('.derror').text("Errors: Please fix " +
> xhr.statustext).show("fast");
>             }
>
> It could be that I am doing something wrong, but that does not explain
> the inconsistent behavior between the 2 browsers. It was this block of
> text that I had to remove to make my forms work even after a refresh.
>
> Thanks,
> Anoop
>
> On Jul 24, 11:01 am, Anoop kumar V  wrote:
>
>
>
> > Attached an html - that shows my situation...
>
> > In the page - clicking on any region opens the pop-up form, and once in a
> > while after you submit the pop-ups are mixed up, you see Newyork details for
> > the Washington tab etc. But as soon as I click on the reset button, it
> > rectifies itself...
>
> > Can somebody please help a bit? I am not able to understand / explain why
> > this happens - I do not have a lot of javascript / jquery code, just the 2
> > functions...
>
> > Should I call reset for all forms after I submit? If so can someone please
> > show / hint at how that can be achieved?
>
> > Thanks,
> > Anoop
>
> > On Fri, Jul 24, 2009 at 2:09 AM, Anoop kumar V wrote:
>
> > > Hi All,
>
> > > I have a very weird issue that I have been trying to resolve for over a
> > > week now with no success in sight.
>
> > > I use jsp to generate a page of regional information. The regions are
> > > displayed as clickable blocks. On clicking each block a pop-up form opens 
> > > up
> > > with the corresponding region details like id, name and acronym. These can
> > > be edited and submitted as updates. There is also a last block that allows
> > > to create a new region which on clicking opens the same kind of form as 
> > > the
> > > others, except all the fields are blank and required.
>
> > > I am using jquery validator plugin (bassistance) to ensure that the user
> > > does not leave any field blank and I also use the form plugin to do an
> > > ajaxsubmit, so that the id enterred is not a duplicate id.
>
> > > On submitting the new region form, a new region gets created and updates
> > > the page fine, but intermittently when I click on the other existing 
> > > blocks
> > > the information shown in the pop-up is for a completely different region:
> > > for example when I click on a block labelled Washington, the popup that
> > > comes up shows New York, NY, 02. On clicking New York block, the same
> > > (correct) information is show. This does not happen always and I have
> > > noticed it happening only in firefox, I use firefox more often also. Also 
> > > if
> > > I take out the ajaxsubmit and do a simple form submit, it seems to not
> > > occur, but I need the ajaxsubmit for the id validation..
> > > Interestingly, when I click on the reset button on the individual form, 
> > > the
> > > values in the fields correct themselves automagically for that form..
>
> > > I also used firebug, and when I mouseover the field in the firebug 
> > > console,
> > > the values in the fields are shown correct (in forebug), except the page
> > > displays the incorrect info. I think this safely eliminates my java code 
> > > as
> > > the culprit... Again - when I reset the particular form, the values are
> > > good, but only for that form, so if I want to clean all such incorrect 
> > > data,
> > > I will have to open each form pop-up on the page and click on the reset
> > > button - this would not work even as a workaround.
>
> > > Below is the code if it helps:
>
> > > *** JS***
> > > $(function() {
> > > var bbap = function() {
> > >       $('.cbnav').live('click',function(event) {
> > >         var target = $(event.target);
> > >         if(($(target).is(".main-title")) || ($(target).is(".cls")))
> > >         {
> > >           $('.details').hide();
> > >           if($(target).is(".main-title"))
> > >             $(target).next('.details').show(450);
> > >         } else if ($(target).is('input[type=reset]')){
> > >             $('.derrors').hide();
> > >             $('.errors').hid

[jQuery] Re: Form values getting unsynchronized after ajaxsubmit [validate]

2009-07-25 Thread anoop

After several attempts, I have been able to consistently reproduce
this problem. It appears that this is an issue with the ajaxSubmit in
the form plugin and only in firefox (latest version), IE 7 does not
seem to have this issue.

The issue occurs in firefox only; when a page with multiple forms is
refreshed (by hitting F5 or ctrl-r) the body of the form and the form
header get unsynchronized. But after clicking on the reset button for
each form it gets rectified.
On IE 7 the refresh did not cause any issue anytime.

I tried after removing the ajaxSubmit and the problem did not occur in
firefox or IE.

I have these lines which I think is the cause of the problem:

submitHandler: function(form) {
$(form).ajaxSubmit({
  target: 'body',
  error: function (xhr) {
$('.derror').text("Errors: Please fix " +
xhr.statustext).show("fast");
}

It could be that I am doing something wrong, but that does not explain
the inconsistent behavior between the 2 browsers. It was this block of
text that I had to remove to make my forms work even after a refresh.

Thanks,
Anoop


On Jul 24, 11:01 am, Anoop kumar V  wrote:
> Attached an html - that shows my situation...
>
> In the page - clicking on any region opens the pop-up form, and once in a
> while after you submit the pop-ups are mixed up, you see Newyork details for
> the Washington tab etc. But as soon as I click on the reset button, it
> rectifies itself...
>
> Can somebody please help a bit? I am not able to understand / explain why
> this happens - I do not have a lot of javascript / jquery code, just the 2
> functions...
>
> Should I call reset for all forms after I submit? If so can someone please
> show / hint at how that can be achieved?
>
> Thanks,
> Anoop
>
> On Fri, Jul 24, 2009 at 2:09 AM, Anoop kumar V wrote:
>
> > Hi All,
>
> > I have a very weird issue that I have been trying to resolve for over a
> > week now with no success in sight.
>
> > I use jsp to generate a page of regional information. The regions are
> > displayed as clickable blocks. On clicking each block a pop-up form opens up
> > with the corresponding region details like id, name and acronym. These can
> > be edited and submitted as updates. There is also a last block that allows
> > to create a new region which on clicking opens the same kind of form as the
> > others, except all the fields are blank and required.
>
> > I am using jquery validator plugin (bassistance) to ensure that the user
> > does not leave any field blank and I also use the form plugin to do an
> > ajaxsubmit, so that the id enterred is not a duplicate id.
>
> > On submitting the new region form, a new region gets created and updates
> > the page fine, but intermittently when I click on the other existing blocks
> > the information shown in the pop-up is for a completely different region:
> > for example when I click on a block labelled Washington, the popup that
> > comes up shows New York, NY, 02. On clicking New York block, the same
> > (correct) information is show. This does not happen always and I have
> > noticed it happening only in firefox, I use firefox more often also. Also if
> > I take out the ajaxsubmit and do a simple form submit, it seems to not
> > occur, but I need the ajaxsubmit for the id validation..
> > Interestingly, when I click on the reset button on the individual form, the
> > values in the fields correct themselves automagically for that form..
>
> > I also used firebug, and when I mouseover the field in the firebug console,
> > the values in the fields are shown correct (in forebug), except the page
> > displays the incorrect info. I think this safely eliminates my java code as
> > the culprit... Again - when I reset the particular form, the values are
> > good, but only for that form, so if I want to clean all such incorrect data,
> > I will have to open each form pop-up on the page and click on the reset
> > button - this would not work even as a workaround.
>
> > Below is the code if it helps:
>
> > *** JS***
> > $(function() {
> > var bbap = function() {
> >       $('.cbnav').live('click',function(event) {
> >         var target = $(event.target);
> >         if(($(target).is(".main-title")) || ($(target).is(".cls")))
> >         {
> >           $('.details').hide();
> >           if($(target).is(".main-title"))
> >             $(target).next('.details').show(450);
> >         } else if ($(target).is('input[type=reset]')){
> >             $('.derrors').hide();
> >             $('.errors').hide();
> >         }
> >     });
> >   }
> >   bbap();
> > });
>
> > var v = $(function() {
> >     $('.main-title').click(function(event) {
> >       var target = $(event.target);
> >       var parent = $(target).parent();
> >       $(parent).validate({
> >         rules: {
> >             regionid: "required",
> >             regionname: "required",
> >             regionacronym: "required"

[jQuery] Re: Form values getting unsynchronized after ajaxsubmit [validate]

2009-07-25 Thread anoop

After several attempts, I have been able to consistently reproduce
this problem. It appears that this is an issue with the ajaxSubmit in
the form plugin and only in firefox (latest version), IE 7 does not
seem to have this issue.

The issue occurs in firefox only; when a page with multiple forms is
refreshed (by hitting F5 or ctrl-r) the body of the form and the form
header get unsynchronized. But after clicking on the reset button for
each form it gets rectified.
On IE 7 the refresh did not cause any issue anytime.

I tried after removing the ajaxSubmit and the problem did not occur in
firefox or IE.

I have these lines which I think is the cause of the problem:

submitHandler: function(form) {
$(form).ajaxSubmit({
  target: 'body',
  error: function (xhr) {
$('.derror').text("Errors: Please fix " +
xhr.statustext).show("fast");
}

It could be that I am doing something wrong, but that does not explain
the inconsistent behavior between the 2 browsers. It was this block of
text that I had to remove to make my forms work even after a refresh.

Thanks,
Anoop


On Jul 24, 11:01 am, Anoop kumar V  wrote:
> Attached an html - that shows my situation...
>
> In the page - clicking on any region opens the pop-up form, and once in a
> while after you submit the pop-ups are mixed up, you see Newyork details for
> the Washington tab etc. But as soon as I click on the reset button, it
> rectifies itself...
>
> Can somebody please help a bit? I am not able to understand / explain why
> this happens - I do not have a lot of javascript / jquery code, just the 2
> functions...
>
> Should I call reset for all forms after I submit? If so can someone please
> show / hint at how that can be achieved?
>
> Thanks,
> Anoop
>
> On Fri, Jul 24, 2009 at 2:09 AM, Anoop kumar V wrote:
>
> > Hi All,
>
> > I have a very weird issue that I have been trying to resolve for over a
> > week now with no success in sight.
>
> > I use jsp to generate a page of regional information. The regions are
> > displayed as clickable blocks. On clicking each block a pop-up form opens up
> > with the corresponding region details like id, name and acronym. These can
> > be edited and submitted as updates. There is also a last block that allows
> > to create a new region which on clicking opens the same kind of form as the
> > others, except all the fields are blank and required.
>
> > I am using jquery validator plugin (bassistance) to ensure that the user
> > does not leave any field blank and I also use the form plugin to do an
> > ajaxsubmit, so that the id enterred is not a duplicate id.
>
> > On submitting the new region form, a new region gets created and updates
> > the page fine, but intermittently when I click on the other existing blocks
> > the information shown in the pop-up is for a completely different region:
> > for example when I click on a block labelled Washington, the popup that
> > comes up shows New York, NY, 02. On clicking New York block, the same
> > (correct) information is show. This does not happen always and I have
> > noticed it happening only in firefox, I use firefox more often also. Also if
> > I take out the ajaxsubmit and do a simple form submit, it seems to not
> > occur, but I need the ajaxsubmit for the id validation..
> > Interestingly, when I click on the reset button on the individual form, the
> > values in the fields correct themselves automagically for that form..
>
> > I also used firebug, and when I mouseover the field in the firebug console,
> > the values in the fields are shown correct (in forebug), except the page
> > displays the incorrect info. I think this safely eliminates my java code as
> > the culprit... Again - when I reset the particular form, the values are
> > good, but only for that form, so if I want to clean all such incorrect data,
> > I will have to open each form pop-up on the page and click on the reset
> > button - this would not work even as a workaround.
>
> > Below is the code if it helps:
>
> > *** JS***
> > $(function() {
> > var bbap = function() {
> >       $('.cbnav').live('click',function(event) {
> >         var target = $(event.target);
> >         if(($(target).is(".main-title")) || ($(target).is(".cls")))
> >         {
> >           $('.details').hide();
> >           if($(target).is(".main-title"))
> >             $(target).next('.details').show(450);
> >         } else if ($(target).is('input[type=reset]')){
> >             $('.derrors').hide();
> >             $('.errors').hide();
> >         }
> >     });
> >   }
> >   bbap();
> > });
>
> > var v = $(function() {
> >     $('.main-title').click(function(event) {
> >       var target = $(event.target);
> >       var parent = $(target).parent();
> >       $(parent).validate({
> >         rules: {
> >             regionid: "required",
> >             regionname: "required",
> >             regionacronym: "required"

[jQuery] Re: Form values getting unsynchronized after ajaxsubmit [validate]

2009-07-24 Thread Anoop kumar V
Attached an html - that shows my situation...

In the page - clicking on any region opens the pop-up form, and once in a
while after you submit the pop-ups are mixed up, you see Newyork details for
the Washington tab etc. But as soon as I click on the reset button, it
rectifies itself...

Can somebody please help a bit? I am not able to understand / explain why
this happens - I do not have a lot of javascript / jquery code, just the 2
functions...

Should I call reset for all forms after I submit? If so can someone please
show / hint at how that can be achieved?

Thanks,
Anoop


On Fri, Jul 24, 2009 at 2:09 AM, Anoop kumar V wrote:

> Hi All,
>
> I have a very weird issue that I have been trying to resolve for over a
> week now with no success in sight.
>
> I use jsp to generate a page of regional information. The regions are
> displayed as clickable blocks. On clicking each block a pop-up form opens up
> with the corresponding region details like id, name and acronym. These can
> be edited and submitted as updates. There is also a last block that allows
> to create a new region which on clicking opens the same kind of form as the
> others, except all the fields are blank and required.
>
> I am using jquery validator plugin (bassistance) to ensure that the user
> does not leave any field blank and I also use the form plugin to do an
> ajaxsubmit, so that the id enterred is not a duplicate id.
>
> On submitting the new region form, a new region gets created and updates
> the page fine, but intermittently when I click on the other existing blocks
> the information shown in the pop-up is for a completely different region:
> for example when I click on a block labelled Washington, the popup that
> comes up shows New York, NY, 02. On clicking New York block, the same
> (correct) information is show. This does not happen always and I have
> noticed it happening only in firefox, I use firefox more often also. Also if
> I take out the ajaxsubmit and do a simple form submit, it seems to not
> occur, but I need the ajaxsubmit for the id validation..
> Interestingly, when I click on the reset button on the individual form, the
> values in the fields correct themselves automagically for that form..
>
> I also used firebug, and when I mouseover the field in the firebug console,
> the values in the fields are shown correct (in forebug), except the page
> displays the incorrect info. I think this safely eliminates my java code as
> the culprit... Again - when I reset the particular form, the values are
> good, but only for that form, so if I want to clean all such incorrect data,
> I will have to open each form pop-up on the page and click on the reset
> button - this would not work even as a workaround.
>
> Below is the code if it helps:
>
> *** JS***
> $(function() {
> var bbap = function() {
>   $('.cbnav').live('click',function(event) {
> var target = $(event.target);
> if(($(target).is(".main-title")) || ($(target).is(".cls")))
> {
>   $('.details').hide();
>   if($(target).is(".main-title"))
> $(target).next('.details').show(450);
> } else if ($(target).is('input[type=reset]')){
> $('.derrors').hide();
> $('.errors').hide();
> }
> });
>   }
>   bbap();
> });
>
> var v = $(function() {
> $('.main-title').click(function(event) {
>   var target = $(event.target);
>   var parent = $(target).parent();
>   $(parent).validate({
> rules: {
> regionid: "required",
> regionname: "required",
> regionacronym: "required",
> regioncode: "required"
> },
> submitHandler: function(form) {
>   $(form).ajaxSubmit({
> target: 'body',
> error: function (xhr) {
>   $('.derror').text("Errors: Please fix " +
> xhr.responseText).show("fast");
> }
>   });
>   return false;
> }
>   });
> });
> });
>
> $('input[type=reset]').click(function() {
> $('.derrors').hideErrors()
> });
> *** /JS***
> *** HTML***
>
> 
>
>
> 
>
>   Washington (WAS)
>
>   
> close 
>
> 
> Id
>
>  readonly="readonly"/>
>
>
> 
>
> 
>
> Acronym
> 
>
>
> 
> 
> Name
>
>  size="20"/>
>
>
> 
>
> 
>
> Code
> 
>
>
> 
> 
>   
>
>
>   
>
>
> 
>
>   
> 
>
>
>
> 
>
>   New York (NY)
>   
>
> close 
> 
>
> Id
>  readonly="readonly"/>
>
>
> 
> 
> Acronym
>