This should help :
$('form > input').each(function() {
    alert(this.name);
    alert($(this).val());
});

Thanks & Regards,
Dhruva Sagar.


Jonathan Swift<http://www.brainyquote.com/quotes/authors/j/jonathan_swift.html>
- "May you live every day of your life."

On Wed, Sep 16, 2009 at 3:26 PM, pritisolanki <pritiatw...@gmail.com> wrote:

>
> Hi All,
>
> I tried
>
>  $("form").each(function() {
>          alert(this.name);
>   alert($("input").val());
>  });
>
> in following HTML
>
>        <form id="form" name="form1">
>                Form 1
>                <input name="foo" value="XXX" />
>        </form>
>
>        <form id="form" name="form2">
>                Form 2
>                <input name="blr" value="YYY" />
>        </form>
>
>        <form id="form" name="form3">
>                Form 3
>                <input type="checkbox" />
>                <input type="checkbox" checked="checked" />
>        </form>
>
> it only alert "XXX" nothing else !!! any idea about this. My journey
> till now is difficult in jquery :-( .Hope to see some answers tomorrow.
>

Reply via email to