Drag-node Chart > Submitting data as form elements |
||||||||||||||||||
Since the drag node chart is a visual data widget, you might need to submit the modified data to your scripts for further processing. The drag-node chart offers you two methods to do the same:
In this section, we'll see how to submit the data to a server side script. |
||||||||||||||||||
| Setting the form | ||||||||||||||||||
To enable submission of data to server side script, you first need to make sure that the submit button is not hidden on your form. To show it, you use the following attribute: <chart ... showFormBtn='1' ...> This adds a submit button to your chart as below: |
||||||||||||||||||
![]() |
||||||||||||||||||
| Now you need to define the form properties i.e., where and how this button would submit the data to. The following attributes let you define the form properties: | ||||||||||||||||||
|
||||||||||||||||||
formAction is the most important attribute which contains the full path to your server side script. e.g., <chart ... showFormBtn='1' formAction='../MyDataProcessor.asp' ..>. If you do not specify this attribute, the form wouldn't submit at all. You can also define the form method (GET or POST) and target (_self or _blank) using the attributes above. Now, in your server side script (MyDataProcess.asp or MyDataProcess.php or MyDataProcess.aspx or ...), you can request the updated XML data from chart as strXML variable. For example, given below is the ASP code that simply requests the XML from chart and outputs it: In your scripts, you can request the XML data, parse it and then process it further as per your requirements. Next, we'll see how to request the chart data in client side JavaScript functions. |