EditLive! 9 Documentation : setAutoSubmit Method

This property specifies the way in which EditLive! behaves when the page is submitted. This affects how content is retrieved from EditLive!.

Syntax 

Visual Basic Script
object.AutoSubmit = blnSubmit
ASP.NET

This property is no longer present in the EditLiveJava ASP.NET control. The standard autosubmit mechanism is always off in ASP.NET and is replaced with alternative autosubmit functionality made specifically for ASP.NET.

JavaScript
editliveInstance.setAutoSubmit(blnSubmit);

Parameters

blnSubmit

A boolean indicating if EditLive! should attach its content submission to the onsubmit function.

The default value is true.

Examples

The following code would inform EditLive! to not attach its content submission to the onsubmit function.

VBScript
editlive1.AutoSubmit = "false"
JavaScript
editlivejs.setAutoSubmit(false);

Remarks

When attaching its content submission to the onsubmit function, EditLive! populates a hidden field with its contents automatically rather than the developer calling for the contents explicitly. The name of the hidden field is contained within the same form as the EditLive! instance and is given the name that was specified by the developer when the EditLive! instance was created. For example, if the applet assigned the name ELApplet1 was specified in the above example, EditLive! would store its contents in the hidden field named ELApplet1. This hidden field is then posted with the rest of the form data when the submit button is pressed. EditLive! automatically updates the hidden field by attaching itself to the form's onsubmit() handler. If there is already a function specified in the onsubmit() handler then this function will run after the hidden field has been updated. This means that you can still use the onsubmit() handler to run your own JavaScript functions. If you use another button/image/event to submit the form by calling form.submit(), the browser will not call the onsubmit() handler and EditLive! will not populate the hidden field with data. For this reason, please ensure you use form.onsubmit() to avoid this problem.

When deactivating the onsubmit functionality of EditLive! by setting the AutoSubmit property to false, the developer may wish to retrieve content from EditLive! using the getDocument Method provided in the EditLive! Run Time Methods.