Using Ajax Button

This example demonstrates the use of AJAX button on a control form.

Creating a Control Form

1. Create a new application Control type.

2. In the application menu open the “Fields” folder and then click on the item “New Field”

3. We will create three fields. Enter the name and the label fields according to the table below:

Name Label
info Informações
browser Navegador
language Idioma

4. In the application menu click the item “Buttons >> New button” and select the type “Ajax”.

5. We will use the following code on the button.


if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
} else {
$lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);

if(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== FALSE) 
$browser = 'Internet explorer';
elseif(strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') !== FALSE) 
$browser = 'Mozilla Firefox';
elseif(strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome') !== FALSE) 
$browser = 'Google Chrome';
if($lang == "pt")
{info} = "Hoje é ".date('d-m-Y').", ".date('H:i:s')." e seu IP é: ".$ip;
{info} = "Today is ".date('d-m-Y').", ".date('H:i:s')." and your IP is: ".$ip;
{browser} = $browser;
{language} = strtoupper($lang);

6. Click the Run button on the toolbar.

Tutorials in the same category

Login Form

1- You must create a new application of Control type and configure it as shown in the image below. ...

Contact Form

In this tutorial we will be preparing an application of the Control Form type in which the format w...

Registration Form

Registration Form 1- You must create a new application of the type Control and configure it as s...

Fields Digital Signature, Select2, Switch and Slider

This example demonstrates the form fields added in version 9.2 of Scriptcase: Digital Signature, Ra...

Comment this post