I am currently playing with a form with multiple submit buttons and I was wondering the correct dtml way of detecting which submit button was pushed: My Submit buttons look like: ... <input type="SUBMIT" name="create" value="Create As New Record (Copy)"> <input type="SUBMIT" name="edit" value="Edit In Place"> <input type="SUBMIT" name="delete" value="Delete This Record"> ... And I would like to know what is the correct way of munging REQUEST.form to switch on which was pressed. Also is there a way of <dtml-if>'ing on the existance of a variable in the namespace? I sometimes want the logical control similar to the &dtml.missing-variable; entity def. brett -- email: Brett.Morgan@uts.edu.au phone: +61-2-9514-2091 A guy goes into a doctor's office. The doctor tells him, "You're fat!" The guy says, "Doctor, I want a second opinion!" The doctor says, "OK, you're ugly, too!"
On Mon, Feb 21, 2000 at 12:33:13AM +1100, Brett Morgan wrote:
... <input type="SUBMIT" name="create" value="Create As New Record (Copy)"> <input type="SUBMIT" name="edit" value="Edit In Place"> <input type="SUBMIT" name="delete" value="Delete This Record"> ...
And I would like to know what is the correct way of munging REQUEST.form to switch on which was pressed.
Also is there a way of <dtml-if>'ing on the existance of a variable in the namespace? I sometimes want the logical control similar to the &dtml.missing-variable; entity def.
<dtml-if "_.hasattr(REQUEST, 'create')"> (user pushed create) <dtml-elif "_.hasattr(REQUEST, 'edit')"> (user pushed edit) <dtml-else "_.hasattr(REQUEST, 'delete')"> (user pushed delete) </dtml-if> (untested, YMMV of course) -Petru
participants (2)
-
Brett Morgan -
Petru Paler