On Sat, Jan 3, 2009 at 8:45 PM, bob <xoxeo...@gmail.com> wrote: > > How do I insert a value to hidden form field "user_name"? > > <form name="myForm" id="myForm" method="post"> > <input type="hidden" name="foo" value="bar"/> > <input type="hidden" name="user_name" value=""/> > </form> > > > jQuery('form#myForm input:hidden ???').val('fast_fish'); > > Thats what I need: > <input type="hidden" name="user_name" value="fast_fish"/>
jQuery("#myForm input[name='user_name']").val('fast_fish'); You can leave out the 'form' part as the ID should be unique on the page.