Root Admin Chewett Posted July 15, 2012 Root Admin Report Posted July 15, 2012 This is the basis of a dynamic driven clickable, buttons! sample code: html: <form method='post'> <input type="submit" name='button' value="Go!"/> </form> MDScript: (locations [Whatever location the clicky is in]) echo @content[0]; if (@input['button'] == 'Go!') { echo "you pressed the button"; }else{ echo "You havent yet pressed the button!"; } Here you have a button and a form, when you press this the "data" is sent to the page again. This data is a associative value, meaning that you have a name that is associated with a value. In this case, all the "name"'s of the objects are associated with their value. For my simple example, The button name is called "button" and its associated value is "Go!" This value is only sent to the page when the button is clicked, This means on the first page load, it isnt sent. When the data is sent to the page, it is stored in the @input variable, so in my example when i press the button @input['button'] will be equal to "Go!" I can do a check to see if @input['button'] == "Go!" to see if it has been pressed or not. This will allow you to respond to user input and do different things. Remember to change the name of each button or input field, so that they are different. More advanced information is available: comments and questions can go on this post Kaya 1 Quote
Root Admin Chewett Posted June 20, 2023 Author Root Admin Report Posted June 20, 2023 I have updated this to fix some of the old formatting issues after various migrations This is a great "Starter" MD Script area CC @Blackshade Rider Quote
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.