EmperorJazzy Posted October 29, 2007 Share Posted October 29, 2007 I have one screen that has multiple buttons/images for varying actions. How do I trap which button/image was clicked in order to carry out the related code events? Do I utilise the value of each button, or the name of each button to identify, and then 'select' the result? Should they all be type=submit? Thanks in advance. Link to comment https://forums.phpfreaks.com/topic/75283-code-relating-to-button-events/ Share on other sites More sharing options...
teng84 Posted October 29, 2007 Share Posted October 29, 2007 have a different name of buttons you one name for all of your button but diff value the do something like this switch($_POST['yourbutton']){ case 'value1': //dothis break; case 'value2': //dothis break; etc,.... } Link to comment https://forums.phpfreaks.com/topic/75283-code-relating-to-button-events/#findComment-380754 Share on other sites More sharing options...
trav Posted October 29, 2007 Share Posted October 29, 2007 although it might be a little bit of a hassle, you could use javascript to built the url with GET variables that track it. Link to comment https://forums.phpfreaks.com/topic/75283-code-relating-to-button-events/#findComment-380768 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.