Simcy Creative
  • What is Simcify
  • Requirements
  • Getting Started
  • Javascript Functions
    • Simple js Functions
    • Interaction Functions
      • Loader
      • Notifications
      • Credit Card Form
    • Helper Functions
      • Random
      • Cookies
      • Send to server(Ajax)
      • Server Responses
    • HTML helpers
      • Form Processing
      • Send onClick
      • Send onChange
      • Fetch & Display
      • Dropify
      • Switchery
      • Crop Image Input
      • Image Preview
  • PHP Functions
    • Introduction
    • Setup
    • Authentication
      • Login
      • Register
      • Forgot Password
      • Reset Password
    • Configuration
    • Email & SMS
      • SMS
        • Africa's Talking
        • Twilio
      • Email
    • Files Manager
      • Upload
      • Delete
Powered by GitBook
On this page
  • usage
  • Response
  1. Javascript Functions
  2. HTML helpers

Send onClick

When you need to send data to the server when an element is clicked, this is your solution.

Any element can be used to achieve this functionality. All need is a class addition called send-to-server-click, additional options are passed via attributes.

Attribute options are;

  • loader

    • Optional

    • "true" or "false"

    • when true, a loader will be shown when button is clicked and hidden when set false.

  • url

    • required

    • url

    • the path to where the form will be submitted

  • data

    • required

    • string. example username:johnd|name:John Doe|email:john@example.com. Separate a key from value with full colon : and separate each group with |

  • warning-title

    • optional

    • Warning title to warn user when needed

  • warning-message

    • optional

    • Warning title to warn user when needed

  • warning-button

    • optional

    • The label of the warning button.

usage

<button class="send-to-server-click" data="username:johnd|name:John Doe|email:john@example.com" url="https://example.com/server" warning-title="Are you sure?" warning-message="This process is irreversable" warning-button="Continue" loader="true">Empty Now</button>

Response

Responses should be JSON, please refer to the server response page for more information.

PreviousForm ProcessingNextSend onChange

Last updated 6 years ago

Server Responses