From: zope-bounces@zope.org [mailto:zope-bounces@zope.org] On
Does anyone know if there is a way to have a button with a label that differs from the value of the button. I am using several buttons in a form that have the same name since they call the same DTML method. I would like to give these buttons the same label without giving them the same value. If the values are all the same, there is no way for me to detect which button was clicked. Any help would be greatly appreciated. Thanks.
In order of (my) preference - 1) Don't tie the button label to the method called. Then you can have different buttons call the same method. 2) Use <button> elements rather than <input> elements. Button elements display their text content as the label. Cheers, Tom P
Hello. I tried using <button> elements instead of <input> elements but they don't work for form submission. Do you have any idea why? I am using IE 5.2 on Mac OS X Panther and the following is my code: <button type="submit" name="edit_data" value="Save Changes">Save Changes</button> edit_data is the name of a DTML method and is the action of the form. However, when I click on this button I get a 'Key Error' informing me that edit_data is a nonexistent object or variable. If I use an <input> element instead, everything works fine. Input elements do not achieve what I want though. Any help would be greatly appreciated. Thanks. - Asad On Wed, 30 Jun 2004, Passin, Tom wrote:
From: zope-bounces@zope.org [mailto:zope-bounces@zope.org] On
Does anyone know if there is a way to have a button with a label that differs from the value of the button. I am using several buttons in a form that have the same name since they call the same DTML method. I would like to give these buttons the same label without giving them the same value. If the values are all the same, there is no way for me to detect which button was clicked. Any help would be greatly appreciated. Thanks.
In order of (my) preference -
1) Don't tie the button label to the method called. Then you can have different buttons call the same method.
2) Use <button> elements rather than <input> elements. Button elements display their text content as the label.
Cheers,
Tom P
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
participants (2)
-
Asad Habib -
Passin, Tom