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. Quote 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,.... } Quote 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. Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.