EasyUI Forum
April 29, 2024, 01:25:50 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: form: clear vs reset  (Read 6231 times)
featheral
Newbie
*
Posts: 14


View Profile
« on: October 07, 2019, 08:47:53 PM »

Hi.
Would appreciate someone clarifying the difference between the two methods.
The docs have only this:
Quote
clear   none   Clear the form data.
reset   none   Reset the form data. Available since version 1.3.2.

Thanks!
Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #1 on: October 08, 2019, 08:33:52 PM »

The 'clear' method just clears the field values. The 'reset' method will reset the field values to their original status.
Logged
featheral
Newbie
*
Posts: 14


View Profile
« Reply #2 on: October 08, 2019, 11:53:17 PM »

Thanks. I find though that this explanation doesn't add much on-top of the quoted docs... Perhaps if someone can explain the methods without circular references (like 'the reset() method resets and the clear() method clears').
Is it that 'reset' will revert the field to a default value, whereas 'clear' will set it to an empty string? What does a field's 'status' include?
Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #3 on: October 09, 2019, 02:47:24 AM »

Please look at this code, the textbox has a 'value1' set as a default value. If you modify its value at runtime, then call 'reset' method, the value will be reset to 'value1'. But if you call 'clear' method, the value will be empty.
Code:
<input class="easyui-textbox" value="value1" name="address" style="width:100%">
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!