Using Ajax Button

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

Creating a Control Form

1. Create a new control type application.

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

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

NameLabel
infoInformation
browserNavigator
languageLanguage

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

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

button

if (!empty($ _SERVER[&# 39; HTTP_CLIENT_IP & # 39;])) {
$ ip = $ _SERVER[&# 39; HTTP_CLIENT_IP & # 39;];
} elseif (!empty($ _SERVER[&# 39; HTTP_X_FORWARDED_FOR & # 39;])) {
$ ip = $ _SERVER[&# 39; HTTP_X_FORWARDED_FOR & # 39;];
} else {
$ ip = $ _SERVER[&# 39; REMOTE_ADDR & # 39;];
}
 
$ lang = substr($ _SERVER[&# 39; HTTP_ACCEPT_LANGUAGE & # 39;], 0, 2);

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

6. Click the Run button on the toolbar.

Tutorials in the same category

Responsive login form 3

To learn how to use the templates available within the ScriptCase in the security module, follo...

Responsive login form 2

To learn how to use the templates available within the ScriptCase in the security module, follo...

Responsive login form

To learn how to use the templates available within the ScriptCase in the security module, follo...

Form with Fixed Label

This option can be selected in the forms of type the Multiple Record, Editable Grid and View. ...

Comment this post