On 11 Jun 2004, at 09:57, Werner Otto wrote:
I am making use of use CGI qw(:standard); to create my form. I need to amend the size of a submit button

print $query->submit(-name=>'button_name', -size=>15, -value=>'value');

and need to tell the button which script to call (ie. action=test.cgi).

You can't do that. The closest you can come in an HTML document is to use JavaScript (attached to the onclick and onkeydown even handlers) to dynamically alter the action. This is a really bad idea as it fails in the absence of JavaScript.


The standard way to get the same effect is to test the value of the button (which you must give a name) in the form handler. You can then do whatever actions you like (which may involve an http redirect to another script). Be aware that it is possible for users to submit forms without clicking on any submit button, so you need to have the form handler act in a sane way if $query->param('button_name') isn't set.

Where can I find documentation on all the attributes of the components

http://www.w3.org/TR/html4/index/elements.html

--
David Dorward
     <http://dorward.me.uk/>
<http://blog.dorward.me.uk/>


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to