[tpm] html forms and submit buttons

Indy Singh indy at indigostar.com
Tue Jun 19 10:04:55 PDT 2007


> I would just alter the name parameter in your input field
Thanks, I'll do it that way.

Indy Singh
IndigoSTAR Software -- www.indigostar.com


  ----- Original Message ----- 
  From: Alex Beamish 
  To: tpm 
  Cc: Indy Singh 
  Sent: Monday, June 18, 2007 11:42 PM
  Subject: Re: [tpm] html forms and submit buttons


  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/20070619/e379e04c/attachment.html 


More information about the toronto-pm mailing list