We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Essential JS2

Syncfusion jQuery based widgets are no longer in active development. Switch to our pure JavaScript based next generation Essential JS 2 library.

Syncfusion Feedback

How to use JS components in PHP?

Platform: jQuery |
Control: General |
Published Date: January 27, 2015 |
Last Revised Date: January 30, 2015 |
Product Version:
Tags: general


Using Syncfusion Essential JavaScript components in a PHP application is simple. It is similar like using the components in a normal HTML page. This section explains you about how to use JS components in a simple PHP form with validation.

Refer the script and theme files in <head> section:

Refer to the necessary scripts and theme files required by the Syncfusion EJ components in the <head> section as follows.



In the above code example, scripts refers to the folder that contains the script files. Make sure that the above mentioned script files are loaded properly.

You can also use the CDN links, instead of referring the scripts and theme files locally. Refer to the following code example.



You can refer to the following link to know more about the necessary scripts files and dependencies script files.


Declare the elements in the <body> section

Specify the necessary tag in the <body> section that you are going to convert as EJ components. In this form validation example, the following three EJ components are used

  • Numeric textbox, in which user needs to specify the age.
  • RichTextEditor(RTE) is used to specify the comments by the user.
  • Button is used to submit the form.

Refer to the following code example to render the form elements in the page.



Initialize the components in the <script> section

The EJ components are initialized in the Script section as follows. During initialization, you can also specify the necessary API’s, and bind events for the components.



Refer to the following code example for the validation is written in PHP.




You can download the sample from the following location.


You can refer to the following common user guide for JavaScript to know more about getting started with the components. Under each components, Concepts and features section is provided that explains about the features of the particular component.


You can also refer to the following class reference link for JavaScript that provides all the properties, methods and events supported by each component.


You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile