You should also ensure that the form submits whether or not the UA has
Javascript enabled. I'd make sure the form action is populated unless
the URL where the form is located can handle the form processing (ie
submitting to itself) or ensure that there is a PHP file capable of
processing the requests if Javascript is disabled.

On Apr 22, 12:27 pm, mkmanning <michaell...@gmail.com> wrote:
> $('input[type=submit]').click(function(){
>   $('#clientListForm').attr('action',this.id.substring(7)+'.php');
>
> });
>
> Assumes you're submits have ids with a submit_ prefix followed by the
> name of the page.
>
> On Apr 22, 9:13 am, Thierry <lamthie...@gmail.com> wrote:
>
> > I currently have the following legacy piece of html:
>
> > <form action="" method="get" name="clientListForm"
> > id="clientListForm">
> >     <input type="submit" name="submit_hello" id="submit_hello"
> > value="Say Hello" onclick="this.form.action = 'hello.php';">
> >     <input type="submit" name="submit_hi" id="submit_hi" value="Say
> > Hi" onclick="this.form.action = 'hi.php';">
> > </form>
>
> > The above probably doesn't look too elegant but can someone suggest to
> > me the best way to initialize this.form.action in jQuery?

Reply via email to