| |||||
API Home >> Creator API >> Client API
Steps to integrate your form in external websites through API script
1. Add the following script tags in the head section of your HTML document.
<script src="http://creator.zoho.com/appcreator/js/jsonform.js" type="text/javascript"></script>
<script src="http://creator.zoho.com/<applicationOwnerName>/form/json/<formLinkid>/" type="text/javascript"></script>
2. To create a form input field, add the following script tag. This will generate the form input required to enter the value for the specified field.
You need to give Deluge field name as the parameter to the Zoho.writeInput()javascript function. To get the deluge field name, refer http://creator.zoho.com/api/reference.
3. To attach a label to the above input, add the following script tag. The Zoho.writeLabel generates the label for the specified column. You need to give Deluge field name
as the parameter to the Zoho.writeLabel()javascript function. To get the deluge field name, refer http://creator.zoho.com/api/reference
<script type="text/javascript">Zoho.writeLabel("<Deluge Script name of the column>");</script>
<script type="text/javascript">Zoho.writeReset("<specify reset button label name>");</script>
Sample HTML Form Builder for the Employee Form
For example, let us take a simple "Employee application" with application owner name as "zoho". It consists of "Employee Form" whose
formlink id is "175", with the following fields.
The code to build this form using the Zoho Creator client API is given below:
<form user="zoho" linkid="175" nexturl="http://creator.zoho.com" onsubmit='Zoho.submit(this); return false;'><script src="http://creator.zoho.com/appcreator/js/jsonform.js" type="text/javascript"></script>
<script src="http://creator.zoho.com/zoho/form/json/175/" type="text/javascript"></script>
<table>
<tr>
<td><script type="text/javascript">Zoho.writeLabel("<Name>");</script></td>
<td><script type="text/javascript">Zoho.writeInput("<Name>");</script></td>
</tr>
<tr>
<td><script type="text/javascript">Zoho.writeLabel("Email_Id");</script></td>
<td><script type="text/javascript">Zoho.writeInput("Email_Id");</script></td>
</tr>
<tr>
<td><script type="text/javascript">Zoho.writeLabel("Address");</script></td>
<td><script type="text/javascript">Zoho.writeInput("Address");</script></td>
</tr>
<tr>
<td><script type="text/javascript">Zoho.writeLabel("Contact");</script></td>
<td><script type="text/javascript">Zoho.writeInput("Contact");</script></td>
</tr>
<tr>
<td><script type="text/javascript">Zoho.writeLabel("Qualification");</script></td>
<td><script type="text/javascript">Zoho.writeInput("Qualification");</script></td>
</tr>
<tr>
<td><script type="text/javascript">Zoho.writeLabel("Department");</script></td>
<td><script type="text/javascript">Zoho.writeInput("Department");</script></td>
</tr>
</table>
<br>
<script type="text/javascript">Zoho.writeSubmit("Button Label Name");</script>
<script type="text/javascript">Zoho.writeReset("Button Label Name");</script>
</form>
<script type="text/javascript">Zoho.writeLabel("Image_1");</script>
<script type="text/javascript">Zoho.writeInput("Image_1");</script>
<script type="text/javascript">Zoho.writeLabel("Image_1",Zoho.imgSrc);</script>
<script type="text/javascript">Zoho.writeInput("Image_1",Zoho.imgSrc);</script>
<script type="text/javascript">Zoho.writeLabel("Image_1",Zoho.imgAlt);</script>
<script type="text/javascript">Zoho.writeInput("Image_1",Zoho.imgAlt);</script>
<script type="text/javascript">Zoho.writeLabel("Image_1",Zoho.imgLink);</script>
<script type="text/javascript">Zoho.writeInput("Image_1",Zoho.imgLink);</script>
<script type="text/javascript">Zoho.writeLabel("Image_1",Zoho.imgTitle);</script>
<script type="text/javascript">Zoho.writeInput("Image_1",Zoho.imgTitle);</script>
2. For url field type, input fields for image source, alt tag, link and title will be automatically be generated. If you want to have control over each of the fields, you have to
specify the following variables as 2nd parameter to the function
Zoho.urlUrl
Zoho.urlLink
Zoho.urlTitle
Sample code snippet is given below :
<script type="text/javascript">Zoho.writeLabel("Url_1");</script>
<script type="text/javascript">Zoho.writeInput("Url_1");</script>
<script type="text/javascript">Zoho.writeLabel("Url_1",Zoho.urlUrl);</script>
<script type="text/javascript">Zoho.writeInput("Url_1",Zoho.urlUrl);</script>
<script type="text/javascript">Zoho.writeLabel("Url_1",Zoho.urlLink);</script>
<script type="text/javascript">Zoho.writeInput("Url_1",Zoho.urlLink);</script>
<script type="text/javascript">Zoho.writeLabel("Url_1",Zoho.urlTitle);</script>
<script type="text/javascript">Zoho.writeInput("Url_1",Zoho.urlTitle);</script>
1. Browser should support Java Script