Skip to content
View in the app

A better way to browse. Learn more.

MagicDuel Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Responding to User Events (simple)

Featured Replies

  • Root Admin

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 :) 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Forum Statistics

  • Total Topics 17.5k
  • Total Posts 182.2k

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.