[jQuery] Re: Help creating a function

2009-02-03 Thread ebru...@gmail.com
Very nice work great. I really have to learn more jquery because it works super. On 3 feb, 21:06, Eric Garside wrote: > Change > $('form').submit(function(){ > to > $('input.counter').change(function(){ > > This will prompt the check to run each time the user changes a value > in any of the conc

[jQuery] Re: Help creating a function

2009-02-03 Thread Eric Garside
Change $('form').submit(function(){ to $('input.counter').change(function(){ This will prompt the check to run each time the user changes a value in any of the concerned fields. On Feb 3, 1:18 pm, "ebru...@gmail.com" wrote: > I get it now. I didn't add a submit button. Do you now if it's also

[jQuery] Re: Help creating a function

2009-02-03 Thread ebru...@gmail.com
I get it now. I didn't add a submit button. Do you now if it's also possible to use it without pressing on the submit so it would be a realtime check. On 3 feb, 19:08, Eric Garside wrote: > Ah, I'm pretty sure i missed wrapping the loop's "this" in a jQuery > obj > > Try replacing this line: > n

[jQuery] Re: Help creating a function

2009-02-03 Thread Eric Garside
Ah, I'm pretty sure i missed wrapping the loop's "this" in a jQuery obj Try replacing this line: num += this.val()*1; with num += $(this).val()*1; Also, do an alert before and after the loop and just see what the values are: alert('Limit: ' + lim + "\nNum: " + num); On Feb 3, 12:58 pm, "ebru...

[jQuery] Re: Help creating a function

2009-02-03 Thread ebru...@gmail.com
Looking good Eric, i tied it out, but it doenst seem to work. I already fixed the bug in the alert with the ' in it, but no reponse when filling in alot of numbers. On 3 feb, 17:48, Eric Garside wrote: > Sorry for that last post, wrong thread. :( > > Anyway, you could try something like this: >

[jQuery] Re: Help creating a function

2009-02-03 Thread Eric Garside
Sorry for that last post, wrong thread. :( Anyway, you could try something like this: $(function(){ $('form').submit(function(){ var num = 0, lim = $('#lim').val()*1; $('input.counter').each(function(){ num += this.val()*1; }); if (num >

[jQuery] Re: Help creating a function

2009-02-03 Thread Eric Garside
Try out the jQuery UI "Scaling" effect. http://docs.jquery.com/UI/Effects/Scale On Feb 3, 11:33 am, Stephan Veigl wrote: > Hi Erwin, > > Of course you can code it by hand, but I would suggest that you take a > look at the various validation plugins for jQuery > (e.g.http://plugins.jquery.com/p

[jQuery] Re: Help creating a function

2009-02-03 Thread Stephan Veigl
Hi Erwin, Of course you can code it by hand, but I would suggest that you take a look at the various validation plugins for jQuery (e.g. http://plugins.jquery.com/project/validate) first. by(e) Stephan 2009/2/3 ebru...@gmail.com : > > Hello, > > I have a site where i want to run a realtime ch