|
Creating a JavaScript Button
Creating a JavaScript Button
Named parameter style
print
$query->button(-name=>'button1',
-value=>'Click
Me',
-onClick=>'doButton(this)');
Old style
print $query->image_button('button1','Click
Me','doButton(this)');
button() creates a JavaScript button. When the
button is pressed, the JavaScript code pointed to by the -onClick parameter is
executed. This only works with Netscape 2.0 and higher. Other browsers do not
recognize JavaScript and probably won't even display the button.
- The first argument(-name is required and specifies
the name of this field.
- The second argument (-value gives the button a
value, and will be used as the user-visible label on the button.
- The third argument (-onClick is any valid
JavaScript code. It's usually a call to a JavaScript function defined somewhere
else (see the
start_html()
method), but can be any JavaScript you like. Multiple lines are allowed, but you
must be careful not to include any double quotes in the JavaScript text.
|
|