[jQuery] Re: Listmenu - tips for making it faster in IE

2009-10-15 Thread Anoop kumar V
Hi Jack,

Are you still planning on implementing this feature of putting a message /
progress bar for IE (and firefox to keep it consistent)? Or have you come up
with any better ways of handling this.

Thanks,
Anoop


On Mon, Aug 17, 2009 at 11:41 PM, Anoop kumar V anoopkum...@gmail.comwrote:

 Hi Jack,

 Yes, if you could do something along those lines, it would be most helpful.
 Would putting a progress bar like gmail be a better option or should it be
 just a loading gifeither would work for me for now.

 Thanks,
 Anoop



 On Fri, Aug 14, 2009 at 2:08 PM, Jack Killpatrick j...@ihwy.com wrote:


 Hi Anoop.

 I spent considerable time tuning the code for performance, but yes, IE
 does lag behind, especially when approaching 1000 items or more. I found
 Safari and Chrome to both be quite fast and Firefox nearly as fast as those.
 The IE issue stems from the code that moves the items from the original UL
 or LI into the separate lists used for each submenu.

 I messed around a little with implementing a built-in Loading... message,
 but found IE's behavior so annoying (it likes to appear hung when it's not
 and workarounds only delayed the load time) that I decided not to include
 that in the plugin. I'm on vacation right now, but early next week could
 take a look at a workaround you might be able to use to show a message and
 then hide it after IE is done chugging way. Let me know and I'll put some
 thought into it.

 Thanks,
 Jack


 Anoop kumar V wrote:

 I am using listmenu and it works fantastically well... except only on
 firefox.

 On IE 7 it is quite slow, the lag is very noticeable - the menu appears
 after about 6-7 seconds and the counts come much later after about 8-10
 seconds. Since this is an intranet app, I need to ensure that IE 7 works
 very well. I have about 2000 elements and they are not at all balanced
 across the alphabets...

 Are there any tips that I could follow such that the menu displays
 quicker in IE? Or at the very least is there a way I can show a Loading...
  text or an animated gif while the menu loads..

 But thank you for this wonderful plugin it is really well made, I only
 wish IE would catch up soon ;-)

 Thanks,
 Anoop







[jQuery] Re: Ajax not working in Firefox

2009-09-08 Thread Anoop kumar V
 english is not well.

 $.ajax({
 type: POST,
 url: newcoleng,
 data: F10=YesF11=No,
 dataType: 'text',
 success: function(data){
 alert( Data Saved:  + data );
 }

 });

 Try it.

 --
 Turtle, turtle, on the ground,
 Pink and shiny, turn around.



 --
 Turtle, turtle, on the ground,
 Pink and shiny, turn around.




-- 

Thanks,
Anoop


[jQuery] Re: Clickable div?

2009-09-04 Thread Anoop kumar V
Can you try this:

$(#logo).click(function(){
  $.cookie('startCookie', 'default').load('http://www.mylink.com
');
   });

You do not have to put the a there as logo being the parent will receive the
click even as part of the event bubbling.

Thanks,
Anoop


On Fri, Sep 4, 2009 at 2:02 PM, Charlie Griefer
charlie.grie...@gmail.comwrote:

 I don't know that you can use a filter the way you're trying to (using the
 colon in #logo:a).

 Filters are more like tr:first (matches the first tr element), tr:odd
 (matches odd-numbered table rows.. good for zebra-striping)...

 See the sections about the various types of filters at
 http://docs.jquery.com/Selectors.

 As far as your issue...

 the 'a' in question is a child of the #logo element, so you'd want

 $('#logo  a').click(function() { });

 http://docs.jquery.com/Selectors/child#parentchild


 On Fri, Sep 4, 2009 at 10:53 AM, lukas animod...@gmail.com wrote:


 Thank you! It somehow does not work.

 Here is what I got:
 $(#logo:a).click(function(){
$.cookie('startCookie', 'default').load('
 http://www.mylink.com');
});

 And here is the html:
div id=logoa href=template language defines the link here/
 a/div

 Does anybody have an idea?




 --
 I have failed as much as I have succeeded. But I love my life. I love my
 wife. And I wish you my kind of success.



[jQuery] Re: slide one div out left while sliding one in right

2009-08-29 Thread Anoop kumar V

You can also try to use animate which is part of jquery core. Look up
some examples on the jquery website, there are quite simple.

-Anoop

On 8/29/09, Charlie charlie...@gmail.com wrote:
 there are lots of plugins to do this

 look for carousel or scroll in a plugin search

 jCarousel and scrollable are 2 excellent ones that come to mind as well as
 scrollto

 W. Young wrote:

 A good example of the behavior I want is on the firefox addons home
 page https://addons.mozilla.org/en-US/firefox/?application=firefox

 At the top, there is a pane for viewing the content of three items at
 a time with a back and forward button to scroll through.
 I need a similar way to slide one item at a time.

 On Aug 26, 10:16 am, W. Young wayland.yo...@docupak.com wrote:


 I have a container div with two inner divs.  I have one inner div
 visible taking up 100% of the visible area and another hidden div.  I
 want the visible div to slide to the left while simultaneously sliding
 the other div in from the right.  This works fine except that while
 the right div is sliding in, it appears below the left div.

 How can this be done?

 Here is the code:

 script type=text/javascript src=js/jQuery/jquery.js/script
 script type=text/javascript src=js/jQuery/effects.core.js/
 script
 script type=text/javascript src=js/jQuery/effects.slide.js/
 script

 script type=text/javascript
         $(document).ready(function() {
                 $(#slide).click(function() {
                         $(#leftDiv).hide('slide', { direction: 'left'
 }, 1000);
                         $(#rightDiv).show('slide', { direction: 'right'
 }, 1000);
                         return false;
                 });
         });
 /script

 div id=container style=height: 100px; 
         div id=leftDiv style=float: left; border: solid 1px black;
 height: 100px; width: 100%;
                 spansome text to slide out left/span
         /div
         div id=rightDiv style=float: left; display: none; border:
 solid
 1px black; height: 100px; width: 100%;
                 spansome text to slide in right/span
         /div
 /div
 div style=clear: both; height: 100px;
         input id=slide type=button value=Slide /
 /div








-- 

Thanks,
Anoop


[jQuery] Re: Jquery Validation plugin doesn't working on ASP NET MVC

2009-08-27 Thread Anoop kumar V

You need to reverse the order of sourcing the javascript files.
Put the jquery 1.3.2.js file before the validate.js.

-Anoop

On 8/27/09, Edgar Méndez. edgar9...@gmail.com wrote:

 I'm trying to use the Jquery Validation plugin on aspnet mvc
 fframework but it doesn't work, when I open the firebug console it
 display an error:

 jQuery is not defined
 [Break on this error] jQuery.extend(jQuery.fn, {\n

 I don´t know how to fix this issue an had already added the
 jquery-1.3.2.js to my scripts, there is the valdiation code I'm using:

 script type=text/javascript src=../../Scripts/
 jquery.validate.js/script
 script type=text/javascript src=../../Scripts/
 jquery-1.3.2.js/script

   script type=text/javascript
   $(document).ready(function(){
 $(#simpleSignUp).validate();
   });
   /script

 form id=simpleSignUpForm action= method=get
 input type=text id=firstname class=required
 minlength=2/
 input type=text id=lastname class=required
 minlength=2/
 input type=text id=username class=required
 minlength=2/
 input type=text id=email class=required email
 minlength=2/
 input type=text id=password class=required
 minlength=8 /
 input type=text id=website class=url /
 input type=submit value=Submit /
 /form

 Any help will be very appreciate,

 Thanks in advance...



-- 

Thanks,
Anoop


[jQuery] Re: [validate] - resetForm not working.

2009-08-19 Thread Anoop kumar V

You need to specify the class as cancel for the back button. It is as
simple as that.

On 8/19/09, Tokasa toka...@gmail.com wrote:

 Hi,
 anybody have experience with this validation plugin?
 http://jquery.bassistance.de/validate/demo/errorcontainer-demo.html

 I need to know how to specify corectly the resetForm() function.

 Simply I need to have submit button to continue (which validates
 before) AND I need to have second submit button which which will go
 step back in my wizard and WILL NOT validate.

 on the link above, in that example it works nicely...but in my
 settings does not.. I have also tried their jquery library etc... but
 did not helped.

 My code is ...the same as in link above..

 $(#PreviousBtn).click(function() {
validator.resetForm();
 });

 but firebugs tells me...
 validator is not defined
 validator.resetForm(); \n


 Thanks
 Tomas



-- 

Thanks,
Anoop


[jQuery] Re: form.bind(submit) firing only once in firefox 3.5 ubuntu

2009-08-18 Thread Anoop kumar V
Are you using any ajax after you submit the form the first time?

Thanks,
Anoop


On Tue, Aug 18, 2009 at 10:07 AM, Dmitriy Likhten dlikh...@gmail.comwrote:


 I have tested this on jQuery 1.2.6 and 1.3.2... After binding a
 form.submit event and returning false due to some logic, the second
 time the form is submitted, the event never executes and false is
 automatically used by the browser.

 Has anyone else experienced this? Is this a browser bug vs a jQuery
 bug?



[jQuery] Re: Listmenu - tips for making it faster in IE

2009-08-17 Thread Anoop kumar V
Hi Jack,

Yes, if you could do something along those lines, it would be most helpful.
Would putting a progress bar like gmail be a better option or should it be
just a loading gifeither would work for me for now.

Thanks,
Anoop


On Fri, Aug 14, 2009 at 2:08 PM, Jack Killpatrick j...@ihwy.com wrote:


 Hi Anoop.

 I spent considerable time tuning the code for performance, but yes, IE does
 lag behind, especially when approaching 1000 items or more. I found Safari
 and Chrome to both be quite fast and Firefox nearly as fast as those. The IE
 issue stems from the code that moves the items from the original UL or LI
 into the separate lists used for each submenu.

 I messed around a little with implementing a built-in Loading... message,
 but found IE's behavior so annoying (it likes to appear hung when it's not
 and workarounds only delayed the load time) that I decided not to include
 that in the plugin. I'm on vacation right now, but early next week could
 take a look at a workaround you might be able to use to show a message and
 then hide it after IE is done chugging way. Let me know and I'll put some
 thought into it.

 Thanks,
 Jack


 Anoop kumar V wrote:

 I am using listmenu and it works fantastically well... except only on
 firefox.

 On IE 7 it is quite slow, the lag is very noticeable - the menu appears
 after about 6-7 seconds and the counts come much later after about 8-10
 seconds. Since this is an intranet app, I need to ensure that IE 7 works
 very well. I have about 2000 elements and they are not at all balanced
 across the alphabets...

 Are there any tips that I could follow such that the menu displays quicker
 in IE? Or at the very least is there a way I can show a Loading...  text
 or an animated gif while the menu loads..

 But thank you for this wonderful plugin it is really well made, I only
 wish IE would catch up soon ;-)

 Thanks,
 Anoop






[jQuery] Re: toggle and logic confusion

2009-08-12 Thread Anoop kumar V
Where are you capturing the click event?

You may want to do something like this:

$(function(){
  $('parent of div#1, div#2  div#3').click(function(event){
$('.hideme').hide();
$(this).find('a.showme').show()
  }
}

If you post your actual html and your click event code if you have one, then
I may be able to help you further..

Thanks,
Anoop


On Wed, Aug 12, 2009 at 7:06 AM, Richard D. Worth rdwo...@gmail.com wrote:


 On Wed, Aug 12, 2009 at 5:40 AM, Bruce MacKay b.mac...@massey.ac.nzwrote:


 Yes, you are right - what I described was like an accordion, but I left
 out the description of the actual links on which the div's are
 opened/closed.

 The links exist as 3 buttons in a horizontal list that remains stationery
 while the divs open/close beneath them.


 Sounds like tabs:

 http://jqueryui.com/demos/tabs/

 http://jqueryui.com/demos/tabs/- Richard



[jQuery] Listmenu - tips for making it faster in IE

2009-08-12 Thread Anoop kumar V
I am using listmenu and it works fantastically well... except only on
firefox.

On IE 7 it is quite slow, the lag is very noticeable - the menu appears
after about 6-7 seconds and the counts come much later after about 8-10
seconds. Since this is an intranet app, I need to ensure that IE 7 works
very well. I have about 2000 elements and they are not at all balanced
across the alphabets...

Are there any tips that I could follow such that the menu displays quicker
in IE? Or at the very least is there a way I can show a Loading...  text
or an animated gif while the menu loads..

But thank you for this wonderful plugin it is really well made, I only wish
IE would catch up soon ;-)

Thanks,
Anoop


[jQuery] Re: Get the ID of a button that is clicked

2009-08-10 Thread Anoop kumar V
Would e.target.id also work in this case?

Thanks,
Anoop


On Mon, Aug 10, 2009 at 3:00 PM, Charlie Griefer
charlie.grie...@gmail.comwrote:

 Aye, but I've been reprimanded (on this list) for suggesting that (and
 incurring the 'overhead' of a jQuery object) when 'this' works just fine :)


 On Mon, Aug 10, 2009 at 11:56 AM, Eduardo Pinzon edcpin...@gmail.comwrote:

 or
 script type=text/javascript
$(function() {

$('#myGroup input:button').click(function(e) {

self.location = 'foo.cfm?id=' + $(this).attr(id);

});
});
 /script


 2009/8/10 Erich93063 erich93...@gmail.com


 WOW I thought I tried that. That was my first instinct. I must have
 had an error somewhere else. That worked. THANKS!

 On Aug 10, 11:50 am, Charlie Griefer charlie.grie...@gmail.com
 wrote:
  this.id
 
 
 
  On Mon, Aug 10, 2009 at 11:48 AM, Erich93063 erich93...@gmail.com
 wrote:
 
   I have a listing of records on a page and an Edit button for each
   record. I want to write some jquery that fires when the button is
   clicked to go to the edit page for the record whose button I clicked.
 
   Here is what I have. Feel free to tel lme to do it completely
   differently if there is an easier way. THANKS!
 
   script type=text/javascript
  $(function() {
 
  $('#myGroup input:button').click(function(e) {
 
  self.location = 'foo.cfm?id=' + I NEED TO GET
 THE ID
   OF THE BUTTON
   CLICKED HERE
 
  });
  });
   /script
 
   div id=myGroup
 
   input type=button id=1 value=Edit
 
   input type=button id=2 value=Edit
 
   input type=button id=3 value=Edit
 
   /div
 
  --
  I have failed as much as I have succeeded. But I love my life. I love
 my
  wife. And I wish you my kind of success.





 --
 I have failed as much as I have succeeded. But I love my life. I love my
 wife. And I wish you my kind of success.



[jQuery] Re: validations

2009-08-03 Thread Anoop kumar V

You can try and use the bassistance form validation plugin. For server
side validation I think you need the (malsup) form plugin as well. You
can google for the exact links or go through the search on jquery.com.


On 8/3/09, pramothireddy swapnadot...@gmail.com wrote:

 Hi,
  I am verymuch new to jquery and wanted to use jauery validations for
 textbox controls in my project.
 how can i...can u please guide me using asp.net with c# we are doing
 web applications

 Ex: textbox accepts only alphabets and should not be empty



-- 

Thanks,
Anoop


[jQuery] Re: Basic questions about jQuery validation plugin.

2009-07-30 Thread Anoop kumar V

I think the validation plugin depends only on the name and not the id.

On 7/29/09, Leon leon...@gmail.com wrote:

 Hello,

 I have a form with a set of input fields. I am going to validate the
 form with jQuery Validation. The field has the value of its ID
 different from the value of its name. I've looked around and tried
 several times with the form validate method. But, it seems like the
 validation got trigged only if the id and the name have the same
 value. But I want to keep the input fields that way. My validation
 function is simple.
 $(document).ready(function() {
   $('#myform').validate({
   rules: {
 score_1 : {required: true}
 });
 })

 My input's

 input id=score_1 type=text  name=score[1] /
 input id=score_2 type=text  name=score[2] /
 input id=score_3 type=text  name=score[3] /
 

 The validate is not trigged in this way.

 Can you help me on this?

 Thank you.

 Leon



-- 

Thanks,
Anoop


[jQuery] Is it possible to hide the destination URL of a link?

2009-07-30 Thread Anoop kumar V
I have a menu, on which is a delete link. The URL of the link is quite
plain: http://mysite.com?delete=trueid=123
(quite obvious I think that the request is to delete the id=123)

I wish to hide the destination URL in the browser from the user - so that it
shows a harmless url like: http://mysite.com?# or similar. The reasons are
more aesthetic than anything else. Also the other advantage is once the user
clicks on the link, and then hits on refresh, the request gets posted again
and because the id=123 has already been deleted, it will just generate an
error.. Does that make sense?

I dont mind using ajax for this - but would love if I could get both options
- ajax and non-ajax.

Thanks,
Anoop


[jQuery] Re: Is it possible to hide the destination URL of a link?

2009-07-30 Thread Anoop kumar V
Yes - but I would not know the id until the user clicks on the link. There
are about 20 other links, each has an id. The user can hover on any link, a
pop up appears with the Delete link, clicking on it will call a URL which
is basically the same page (it is a jsp page) which see that the parameter
delete=true and based on that it knows that this is a delete request and the
id to delete is also passed to it.

To some extent I have figured out a way to hide the url. below is the jquery
code: I have bound the click event to the a element

 var target = $(event.target);
  if($(target).is(a))
  {
if ($(target).text() == Delete)
{
  var reg = $(this).find('.details input:first').val();
  $.get(window.location + ?delete=trueid= + reg);
}
  }

The problem I am facing now is that sometimes the page updates itself to
show the id that was deleted and sometimes even though the id was deleted,
the page does not reflect the deletion until the page is refreshed using F5.


Also I thought the $.get would be an async ajax request, but it seems the
whole page is hard refreshed (even though it seems useless because the id
deleted is still shown on the page, again  - goes away after the manual F5).
I have just tried a lot of things using .load in the success, .ajax, .post
etc etc, but I have the same issue.

Thanks,
Anoop


On Fri, Jul 31, 2009 at 1:20 AM, rupak mandal rupakn...@gmail.com wrote:

 Hi anoop  I think you can store the required data in session.


 On Fri, Jul 31, 2009 at 5:19 AM, Anoop kumar V anoopkum...@gmail.comwrote:

 I have a menu, on which is a delete link. The URL of the link is quite
 plain: http://mysite.com?delete=trueid=123
 (quite obvious I think that the request is to delete the id=123)

 I wish to hide the destination URL in the browser from the user - so that
 it shows a harmless url like: http://mysite.com?# or similar. The reasons
 are more aesthetic than anything else. Also the other advantage is once the
 user clicks on the link, and then hits on refresh, the request gets posted
 again and because the id=123 has already been deleted, it will just generate
 an error.. Does that make sense?

 I dont mind using ajax for this - but would love if I could get both
 options - ajax and non-ajax.

 Thanks,
 Anoop





[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 jackmcl...@infocode007.comwrote:


 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 anoopkum...@gmail.com 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 anoopkum...@gmail.com 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 anoopkum...@gmail.com
 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

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

2009-07-26 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 anoopkum...@gmail.com 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 anoopkum...@gmail.comwrote:

  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

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

2009-07-26 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 anoopkum...@gmail.com 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 anoopkum...@gmail.comwrote:

  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

[jQuery] Re: Looking for expand/collapse tree directory navigation

2009-07-26 Thread Anoop kumar V
Would this work for you?

http://jquery.bassistance.de/treeview/demo/

sample 0 seems to fit your requirements.

Thanks,
Anoop


On Sat, Jul 25, 2009 at 4:10 PM, Magnificent 
imightbewrongbutidontthin...@gmail.com wrote:


 Hello,

 I'm looking for an expanding/collapsing tree directory type of
 navigation and was wondering if someone knows of a good one that's out
 there and available.

 What I'm specifically looking for is one that is triggered on the
 click of a *graphic* that toggles the show/hide.  Each text nav item
 should be hyperlinkable to it's own link/page.  So for example (the +
 and - are the collapse/expand graphics, the dot leader is for some
 formatting):

 - Nav Item 1 (text should be hyperlinkable)
 ...Sub Nav 1(text should be hyperlinkable)
 ...- Sub Nav 2 (text should be hyperlinkable)
 ..Sub Nav 2a (text should be hyperlinkable)
 ..Sub Nav 2b (text should be hyperlinkable)
 ..Sub Nav 2c (text should be hyperlinkable)
 ...Sub Nav 3 (text should be hyperlinkable)
 + Nav Item 2 (text should be hyperlinkable)
 + Nav Item 3 (text should be hyperlinkable)
 + Nav Item 4 (text should be hyperlinkable)

 Ideally, this would work for plain old ul and li structure.  I
 suppose infinite nesting would be cool, but I don't think I need to go
 beyond 3 levels with the first 2 levels having the show/hide graphic
 triggers.


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

2009-07-24 Thread Anoop kumar V
input type=text name=regionname value=New York
size=20/

/div
div class=form-class
labelCode/label

input type=text name =regioncode value=NY size=2/

/div
div class=btn

  input type=submit value=Submit/

  input type=reset name=resetButton value=Reset /

/div
  /div
/form

  form class=cbnav action=user/region.jsp

div class='main-title'New Region/div
div class=details

  div class=clsclose /div
  span class=derror/span

  input type=hidden name=create value=1/

  div class=form-class
  labelId/label

  input type=text name=regionid size=2/

  /div
  div class=form-class
  labelAcronym/label

  input type=text name=regionacronym size=3/

  /div
  div class=form-class
  labelName/label

  input type=text name=regionname size=20/

  /div
  div class=form-class
  labelCode/label

  input type=text name=regioncode size=3/

  /div
  div class=btn
input type=submit value=Submit/

input type=reset name=resetButton value=Clear /

  /div
/div
  /form
/div

*** /HTML***

CSS*
.cbdd {
background-color: ghostwhite;
border:1px solid darkblue;
display: block;
margin: 1em;
padding: 1em;
overflow:auto;
}

.cbnav {
width: 18em;
float: left;
margin: .5em .5em .5em .5em;
text-align: left;
}

.main-title {
font: normal small-caps bold 1.35em/170% Lucida Grande,sans-serif;
padding: 0 .25em 0 1em;
color: #888;
background: #003399;
cursor: pointer;
}

.main-title:hover {
color: #fff;
background: #0A42AF;
}

.cbnav .details {
border-top: 1px solid red;
margin-top: 1px;
background: ivory;
display: none;
position: absolute;
width: 20em;
border: 1px solid #888;
border-top: 2px solid #a00;
}

.cls {
background: #fff url(../images/close.gif) no-repeat right bottom;
clear: both;
cursor: pointer;
color: darkgray;
font: normal small-caps bold 1em/100% Lucida Grande,sans-serif;
text-align: right;
padding-right: 12px;
margin: 2px 3px 0 0;
float:right;
}

.cls:hover {
background: #fff url(../images/close_hover.gif) no-repeat right bottom;
color: #000;
}

.form-class {
margin-top: 5px;
width: 30em;
text-align: left;
padding: 0em .1em;
}

.form-class label {
float: left;
width: 5em;
font: normal small-caps bold 1.25em/100% Lucida Grande,sans-serif;
}
***/CSS*

Thanks for any help,
Anoop


[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 anoopkum...@gmail.comwrote:

 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***

 div class=cbdd


 form class=cbnav action=user/region.jsp method=post

   div class='main-title'Washington (WAS)/div

   div class=details
 div class=clsclose /div

 div class=form-class
 labelId/label

 input type=text name=regionid value=01 size=2 
 readonly=readonly/


 /div

 div class=form-class

 labelAcronym/label
 input type=text name=regionacronym value=WAS size=3/


 /div
 div class=form-class
 labelName/label

 input type=text name=regionname value=Washington 
 size=20/


 /div

 div class=form-class

 labelCode/label
 input type=text name =regioncode value=M00 size=2

[jQuery] Test - please ignore

2009-07-24 Thread anoop

Test - please ignore


[jQuery] Re: Test - please ignore

2009-07-24 Thread Anoop kumar V
Thanks - but if you really should, then please acknowledge my actual posts:

http://groups.google.com/group/jquery-en/browse_thread/thread/130b4df144c2e0b9

I would much appreciate any help you could provide.. :-)

-Anoop


On Fri, Jul 24, 2009 at 12:26 PM, Liam Potter radioactiv...@gmail.comwrote:


 no, I will acknowledge!

 anoop wrote:

 Test - please ignore





[jQuery] Re: Username availability check and form validation

2009-07-20 Thread Anoop kumar V
Also - maybe you have a typo - should the line not be:

   else if(data=='yes')

instead of

   else if(data='yes')

Thanks,
Anoop


On Mon, Jul 20, 2009 at 3:59 PM, James james.gp@gmail.com wrote:


 The code you provided is just the check when the field has the blurred
 event called. Are you also doing the check when the form is submitted?
 You have to do some kind of check on form submit, and if it doesn't
 pass, do a return false; and the form should not be submitted.

 On Jul 20, 2:28 am, psykeeq ales.fa...@gmail.com wrote:
  So I have a JQuery/ajax username availability check function which
  calls a file check.php that scans the database  for existing username
  and lets you know if the one typed in is occupied or not. And this
  availabilty check is inside a registration form witch has some simple
  validation rules like required password, required email... The only
  think that is getting me frustrated is that even if the uname function
  says that the username is not available the form lets me through and
  I can still press the submit button and go to the next page.
  So I want my form not to validate if this function tells that the
  username is not available.
  I tried to create a custom rule and some other things but I couldnt
  get it done so if somebody could help me it would be really great. tnx
 
  $(document).ready(function()
  {
  $(#uname).blur(function()
  {
  $(#msgbox).removeClass().addClass('messagebox').text
  ('Checking...').fadeIn(1000);//remove all the class add the messagebox
  classes and start fading
  $.get(check.php,{ uname:$(this).val() }
 ,function(data)//check the
  username exists or not from ajax
  {
if(data=='no') //if username not avaiable
{
  $(#msgbox).fadeTo(200,0.1,function() //start
 fading the
  messagebox
  {
   $(this).html('This User name Already
 exists').addClass
  ('messageboxerror').fadeTo(900,1); //add message and change the class
  of the box and start fading
  });
}
else if(data='yes')
{
  $(#msgbox).fadeTo(200,0.1,function()  //start
 fading the
  messagebox
  {
//add message and change the class of the box
 and start fading
$(this).html('Username available to
 register').addClass
  ('messageboxok').fadeTo(900,1);
  });
}
  });
  });



[jQuery] Re: Best practice for integrating server-side validation (jsp) with jquery validation (specially bassistance)

2009-07-15 Thread Anoop kumar V
OK - this is the approach I intend to take. Please let me know if I am on
the right path - or any links or pointers would also help.

My application is currently a jsp page that shows some tabs. Each tab is an
object that has various properties like name, code, id etc.

Clicking on each tab brings up a pop-up (simple using jquery show  hide)
The pop-up which is basically a form shows the properties as text fields and
can be modified.
There is a submit button at the bottom of this pop up / form that will
submit the form and post the action to another jsp (update.jsp say) that
will update the tables with the data in the database.

I am also using the validation plugin - bassistance. The client side
validation was quite trivial to do, like the id should be digits only,
required fields etc.

I need to extend these validation rules to the server-side like for example
the id needs to be unique in the table and a duplicate value should show an
error message as Id already exists

I am planning to address this requirement by using
jQuery.validator.addMethod to add a new custom validation.
In this validation I will check for an element errors. If the value of this
element errors is true, then I will display an error message. The code
will roughly be like this:

jQuery.validator.addMethod(
servererrors,
function(value, element) {
if (element.value == true)
{
return false;
}
else return true;
},
Errors on the form, please fix.
);

(I intend to fine tune this further once I grasp the concept - so I admit
the validation is crude now)
In my form (the popup actually) I will add a new hidden field errors that
will be populated from update.jsp based on server side rules.

In my form (pop up) I will add this as a rule to one of the fields -
probably the first one so the error message appears adjacent to it.
Something along these lines

$(function() {
$('.main-title').click(function(event) {
var v = $(event.target).parent();
v.validate({
rules: {
regionid:
{
required: true,
enter01: true,
servererrors: true
}
}
 }
  }
}

Is my approach correct or is there something simpler / best practice? Also I
am not sure if my pop up will stay during all this validation, or will it
just close and I will have to figure out a way to display the pop-up again?
Finally should the error / validation message be associated to a visible
field only so that it is visible and adjacent to that field?

Any help is very much appreciated.

Thanks,
Anoop


On Wed, Jul 15, 2009 at 12:49 AM, Anoop kumar V anoopkum...@gmail.comwrote:

 Hi All,

 I was wondering if there is a link or pointers for best practices while
 integrating client side validation errors with server side validation. I
 read on a forum that this requires the server side to return a json, but
 could not find many pointers or details about this.

 Can somebody please provide some tips on how best to achieve this? By the
 way I am using the bassistance plugin, my application is a legacy app
 written in jsp  is database intensive; And so far I have not considered
 using ajaxform etc..

 Thanks,
 Anoop



[jQuery] Multiple forms / validation error message focus

2009-07-14 Thread anoop

Hi,

I am really new to jquery and have been using it for the past few
weeks. I have an issue that I am stuck in, would be grateful if
someone could assist a little.

I use java / jsp for a small application of mine. The application
displays all regions as links on a page and for each region, I show a
form as a pop up (using jquery - hide / show). The form allows the
user to modify the information about the region, and for this it has a
few fields and a submit button.

I am using the bassistance validation plugin for validating that the
user does not leave any field blank.

The problem I am having is that the validation error messages are
displayed only on the first form and not on any other form on the
same. I have ensured that the forms do not have the same id. But all
forms have the same class which I am trying to make use of.

I am thinking I need to get the index of the form and then call the
validate function on that form, but I am not sure if I am on the right
path.

The js file contents are below:
***
$(function() {
$('.main-title').click(function(event) {
$('.details').hide();
$(this).parent().children('.details').show(450);
event.stopPropagation();
});
});

$(function() {
$('.cls').click(function(event) {
$('.details').hide();
event.stopPropagation();
});
});

jQuery.validator.addMethod(
enter01,
function(value, element) {
if (element.value == 01)
{
return false;
}
else return true;
},
Already exists.
);


$(function() {
$(this).form.validate({ // I also tried putting $
(.cbnav).validate
rules: {
regionid:
{
required: true,
enter01: true
},
regionname: required,
regionacronym: required,
regioncode: required
},
messages: {
regioncode: Region Code can be 3 characters only
}
});
});

***

The html snippet is below - showing 2 forms
***
form class=cbnav action=user/region.jsp method=post
  div class='main-title'Washington DC/div

  div class=details
div class=clsclose [x]/div
div class=form-class
label for=regionidRegion Id
input type=text name=regionid value=01
size=2 readonly=readonly/
/label
/div
div class=form-class
label for=regionacronymRegion Acronym
input type=text name=regionacronym
value=WAS size=3/

/label
/div
div class=form-class
label for=regionnameRegion Name
input type=text name=regionname
value=Washington DC size=20/
/label
/div
div class=form-class
label for=regioncodeRegion Code
input type=text name=regioncode value=01
size=2/

/label
/div
div class=form-classinput type=submit
value=Submit//div
  /div
/form


form class=cbnav action=user/region.jsp method=post
  div class='main-title'Atlanta /div
  div class=details

div class=clsclose [x]/div
div class=form-class
label for=regionidRegion Id
input type=text name=regionid value=02
size=2 readonly=readonly/
/label
/div
div class=form-class
label for=regionacronymRegion Acronym
input type=text name=regionacronym
value=ATL size=3/

/label
/div
div class=form-class
label for=regionnameRegion Name
input type=text name=regionname
value=Atlanta size=20/
/label
/div
div class=form-class
label for=regioncodeRegion Code
input type=text name=regioncode value=10
size=2/

/label
/div
div class=form-classinput type=submit
value=Submit//div
  /div
/form

***

Also another issue I am facing (sort of related to this as even this
works only on the first form) is that in Firefox, when I click on the
input fields in the pop-up form, the focus does not stay. It works
fine in IE. I tried a lot of different options, by calling
(input:text).focus() etc etc, but the focus would work only for the
first form fields and none other.I think the solution to both issues
will be similar.

Thanks in advance.


[jQuery] Re: Multiple forms / validation error message focus

2009-07-14 Thread Anoop kumar V
Hi All,

I think I have been able to solve the issue of the validation error messages
not appearing on the correct form. If anyone else encounters the same
problem, below is the fix / solution for it. (I had to use the event and
firebug console). Changed lines are marked with a trailing //.

$(function() {
$('.main-title').click(function(event) { //
$(event.target).parent().validate({   //
rules: {
regionid:
{
required: true,
enter01: true
},
regionname: required,
regionacronym: required,
regioncode: required
},
messages: {
regioncode: Region Code can be 3 characters only
}
  });
});
});

I am still having the issue with the focus, when I click inside a field, the
cursor (to type) does not stay inside.

Thanks,
Anoop


Thanks,
Anoop


On Tue, Jul 14, 2009 at 12:02 PM, anoop anoopkum...@gmail.com wrote:


 Hi,

 I am really new to jquery and have been using it for the past few
 weeks. I have an issue that I am stuck in, would be grateful if
 someone could assist a little.

 I use java / jsp for a small application of mine. The application
 displays all regions as links on a page and for each region, I show a
 form as a pop up (using jquery - hide / show). The form allows the
 user to modify the information about the region, and for this it has a
 few fields and a submit button.

 I am using the bassistance validation plugin for validating that the
 user does not leave any field blank.

 The problem I am having is that the validation error messages are
 displayed only on the first form and not on any other form on the
 same. I have ensured that the forms do not have the same id. But all
 forms have the same class which I am trying to make use of.

 I am thinking I need to get the index of the form and then call the
 validate function on that form, but I am not sure if I am on the right
 path.

 The js file contents are below:
 ***
 $(function() {
$('.main-title').click(function(event) {
$('.details').hide();
$(this).parent().children('.details').show(450);
event.stopPropagation();
});
 });

 $(function() {
$('.cls').click(function(event) {
$('.details').hide();
event.stopPropagation();
});
 });

 jQuery.validator.addMethod(
enter01,
function(value, element) {
if (element.value == 01)
{
return false;
}
else return true;
},
Already exists.
);


 $(function() {
$(this).form.validate({ // I also tried putting $
 (.cbnav).validate
rules: {
regionid:
{
required: true,
enter01: true
},
regionname: required,
regionacronym: required,
regioncode: required
},
messages: {
regioncode: Region Code can be 3 characters only
}
});
 });

 ***

 The html snippet is below - showing 2 forms
 ***
 form class=cbnav action=user/region.jsp method=post
  div class='main-title'Washington DC/div

  div class=details
div class=clsclose [x]/div
div class=form-class
label for=regionidRegion Id
input type=text name=regionid value=01
 size=2 readonly=readonly/
/label
/div
div class=form-class
label for=regionacronymRegion Acronym
input type=text name=regionacronym
 value=WAS size=3/

/label
/div
div class=form-class
label for=regionnameRegion Name
input type=text name=regionname
 value=Washington DC size=20/
/label
/div
div class=form-class
label for=regioncodeRegion Code
input type=text name=regioncode value=01
 size=2/

/label
/div
div class=form-classinput type=submit
 value=Submit//div
  /div
/form


form class=cbnav action=user/region.jsp method=post
  div class='main-title'Atlanta /div
  div class=details

div class=clsclose [x]/div
div class=form-class
label for=regionidRegion Id
input type=text name=regionid value=02
 size=2 readonly=readonly/
/label
/div
div class=form-class
label for=regionacronymRegion Acronym
input type=text name=regionacronym
 value=ATL size=3/

/label
/div
div class=form-class
label for=regionnameRegion Name
input

[jQuery] Re: Multiple forms / validation error message focus

2009-07-14 Thread Anoop kumar V
The reason I think $(.main-title form) will not work for my case is
because my form is structured like the following:

form class=cbnav method=post action=user/region.jsp  div class
=main-titleKansas City (KC)/div
 div class=details
 /div
/form

So the form is actually a parent of the main-title div. But the main-title
has nothing to do with the form, so I tried to move it out and up also, but
that seemed to mess up the entire style of the form.

Also - I call the validate when the main-title is clicked which is when the
pop-up actually comes, so unless the user clicks on the main-title again and
again the validate will not get called. I am very new to all this, so please
let me know if I am talking nonsense.


Thanks,
Anoop


On Tue, Jul 14, 2009 at 4:55 PM, Jörn Zaefferer 
joern.zaeffe...@googlemail.com wrote:

 You shouldn't initialize the validation inside a click-event handler -
 that way it tries to init it on every click.

 Why not just select the form and call validate, eg.

 $(.main-title form).validate({ ... });

 Jörn

 On Tue, Jul 14, 2009 at 10:42 PM, Anoop kumar Vanoopkum...@gmail.com
 wrote:
  Hi All,
 
  I think I have been able to solve the issue of the validation error
 messages
  not appearing on the correct form. If anyone else encounters the same
  problem, below is the fix / solution for it. (I had to use the event and
  firebug console). Changed lines are marked with a trailing //.
 
  $(function() {
  $('.main-title').click(function(event) { //
  $(event.target).parent().validate({   //
  rules: {
  regionid:
  {
  required: true,
  enter01: true
  },
  regionname: required,
  regionacronym: required,
  regioncode: required
  },
  messages: {
  regioncode: Region Code can be 3 characters only
  }
});
  });
  });
 
  I am still having the issue with the focus, when I click inside a field,
 the
  cursor (to type) does not stay inside.
 
  Thanks,
  Anoop
 
 
  Thanks,
  Anoop
 
 
  On Tue, Jul 14, 2009 at 12:02 PM, anoop anoopkum...@gmail.com wrote:
 
  Hi,
 
  I am really new to jquery and have been using it for the past few
  weeks. I have an issue that I am stuck in, would be grateful if
  someone could assist a little.
 
  I use java / jsp for a small application of mine. The application
  displays all regions as links on a page and for each region, I show a
  form as a pop up (using jquery - hide / show). The form allows the
  user to modify the information about the region, and for this it has a
  few fields and a submit button.
 
  I am using the bassistance validation plugin for validating that the
  user does not leave any field blank.
 
  The problem I am having is that the validation error messages are
  displayed only on the first form and not on any other form on the
  same. I have ensured that the forms do not have the same id. But all
  forms have the same class which I am trying to make use of.
 
  I am thinking I need to get the index of the form and then call the
  validate function on that form, but I am not sure if I am on the right
  path.
 
  The js file contents are below:
  ***
  $(function() {
 $('.main-title').click(function(event) {
 $('.details').hide();
 $(this).parent().children('.details').show(450);
 event.stopPropagation();
 });
  });
 
  $(function() {
 $('.cls').click(function(event) {
 $('.details').hide();
 event.stopPropagation();
 });
  });
 
  jQuery.validator.addMethod(
 enter01,
 function(value, element) {
 if (element.value == 01)
 {
 return false;
 }
 else return true;
 },
 Already exists.
 );
 
 
  $(function() {
 $(this).form.validate({ // I also tried putting $
  (.cbnav).validate
 rules: {
 regionid:
 {
 required: true,
 enter01: true
 },
 regionname: required,
 regionacronym: required,
 regioncode: required
 },
 messages: {
 regioncode: Region Code can be 3 characters only
 }
 });
  });
 
  ***
 
  The html snippet is below - showing 2 forms
  ***
  form class=cbnav action=user/region.jsp method=post
   div class='main-title'Washington DC/div
 
   div class=details
 div class=clsclose [x]/div
 div class=form-class
 label for=regionidRegion Id
 input type=text name=regionid value=01
  size=2 readonly=readonly/
 /label
 /div
 div class=form-class
 label for=regionacronymRegion Acronym

[jQuery] Best practice for integrating server-side validation (jsp) with jquery validation (specially bassistance)

2009-07-14 Thread Anoop kumar V
Hi All,

I was wondering if there is a link or pointers for best practices while
integrating client side validation errors with server side validation. I
read on a forum that this requires the server side to return a json, but
could not find many pointers or details about this.

Can somebody please provide some tips on how best to achieve this? By the
way I am using the bassistance plugin, my application is a legacy app
written in jsp  is database intensive; And so far I have not considered
using ajaxform etc..

Thanks,
Anoop