[tpm] html forms and submit buttons

Alex Beamish talexb at gmail.com
Mon Jun 18 20:42:19 PDT 2007


On 6/18/07, Indy Singh <indy at indigostar.com> wrote:
>
> Hello all,
>
> I have an HTML form where I use several differnt button to trigger
> different actions, e.g.
> <input  type="Submit" NAME="action" VALUE="Open">
> <input  type="Submit" NAME="action" VALUE="Close">
>
> The problem with this approach is that if the script that processes this
> has hard coded values "Open" and "Close", then the form can't be altered
> to support a differnt language.  Is there a way for a submit button in
> HTML to display differnt text than what gets submitted to a SCI script?


Hi Indy,

I would just alter the name parameter in your input field .. then you just
look for which name is present in the variable stream that gets returned --
you'll only get one of the button's names. You can even look for the pattern
/(\w+)_action/ .. then the values (what's actually displayed on the button)
can be in whatever language is appropriate.

English:
  <input  type="Submit" VALUE="Open" NAME="open_action">
  <input  type="Submit" VALUE="Close" NAME="close_action">

or

French:
  <input  type="Submit" VALUE="Ouvrez" NAME="open_action">
  <input  type="Submit" VALUE="Fermez" NAME="close_action">

-- 
Alex Beamish
Toronto, Ontario
aka talexb
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/pipermail/toronto-pm/attachments/20070618/a8c0c6ec/attachment.html 


More information about the toronto-pm mailing list