Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Bug report: validation errors clears upload field content

    Hi,

    Is this the right place to place bug reports?

    Here it is one that i found.

    When i try to submit a form that have validation errors, all uploads fields are cleared up and user have to select the file again. I don't know why this happens but i don't see a reason why the upload field is cleared up.

    Sample code to reproduce the problem:

    Code:
    <html>
    	<head>
    		<!-- Include SmartClient scripts here! -->
    	</head>
    	<body>
    		<script type="text/javascript">
    		isc.DynamicForm.create({
    			'ID': 'sampleForm',
    			'action': 'upload.html',
    			'canSubmit': true,
    			'fields': [
    			           {
    					title: 'Upload',
    					type: 'upload'
    			           },
    			           {
    					title: 'My required field',
    					type: 'text',
    					required: true
    			           },
    			           {
    					title: 'Send',
    					type: 'button',
    					click: function() {
    						if ( sampleForm.validate() ) { sampleForm.submit(); }
    			           	}
    			           }
    			]
    		});	
    		</script>
    	</body>
    </html>
    Steps to reproduce: select a file to upload and try to submit if without typing anything on the required text field.

    Is there a workaround for this problem? It is annoying for users, specially on big forms, because they have to select all file fields again.

    #2
    Not really a bug but a side-effect of how forms are redrawn after validation. See the docs for UploadItem which is used by FileItem for details and recommended practice for the situation.

    Comment

    Working...
    X