Let me check a little point though, did you set the *id* of your input to "act" or was "act" just the *name* ? Because this selector : $('#act') selects an element that has the *id* "act", whereas in vanilla DOM document.your_form.act points to the element that has the *name* "act". If so, no wonder your field wasn't changed in time, or at all.
Michel Belleville 2009/11/26 Adods <thead...@gmail.com> > i've tried that one too, and get the same result. but now i already > get the solution by using old way: > > document.pm_form.act.value = 'value'; > > btw, thanks for the help :) > > On Nov 24, 9:32 pm, Michel Belleville <michel.bellevi...@gmail.com> > wrote: > > I think I've had something similar once, I'm not sure how I got it to > work > > properly but you can try something on lines of : > > setTimeout("$('#pm_form').submit();", 1); > > > > So you've returned and applied the changed before the form actually > submits. > > > > Michel Belleville > > > > 2009/11/24 achmad dodi <thead...@gmail.com>> Hello, > > > > > I have a problem with submitting a form using a link, multiple link > > > > > here is an example link i'm gonna use: > > > > > <a href="#" class="commandBtn" rel="mark" title="Mark as Read">Mark as > > >> Read</a> <a href="#" class="commandBtn" rel="remove" title="Remove to > > >> Trash">Remove to Trash</a> > > > > > the result I expect is when the link is clicked, a hidden input value > > > replaced with `rel` attribute on the link and then submit the form, and > here > > > is the code: > > > > > $('a.commandBtn').click(function () { > > >> $('#act').val(this.rel); > > >> $('#pm_form').submit(); > > >> return false; > > >> }); > > > > > but after the form submitted, when I check the $_POST['act'] variable > in > > > PHP, it's return a default value. > > > if I disabled the submit line in code above, the value change normally. > > > but when I check it again using Firebug with submit line enabled, the > #act > > > hidden input value change when the form is being submitted. > > > there is some delay when setting a value, as the result, the value is > > > updated when the form is being submitted. > > > > > can anyone give me a solution for this? > > > and sorry for my bad english > > > > > *Regards,* > > > Achmad A. >