Spry

Change required status of a text field

By default, Validation Text Field widgets require user input when published on a web page. You can, however, make the completion of text fields optional for the user.

 To change the required status of a text field, add the isRequired property to the constructor and set its value to false, as follows:
<script type="text/javascript">
	var textfieldwidget1 = new Spry.Widget.ValidationTextField("textfieldwidget1", "none", {isRequired:false});
</script>
Note: In the preceding example, the second parameter is set to "none", but it could easily be set to any of the available validation types (for example, "phone" or "credit_card"). See Specify a validation type and format.

Comments

Comments are no longer accepted for Spry 1.4. Spry 1.6 is the current version. To discuss Spry 1.4, please use the Adobe forum.

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/en_US/Spry/1.4/WS9787A41C-230B-403f-875C-D75FD298BFA3.html