Use the persist attribute in textbox on XUL

Source: Internet
Author: User
XUL (XML user language) comes with the persist attribute, which is a good attribute. The main function is to use the XUL mechanism to help you remember some values, which will be stored in the localstore. RDF file. Here I will mainly talk about a problem I encountered, which is easy to use. For example, remember that the checkbox check status can be written as follows:

<Checkbox label = "enable Javascript" Checked = "true" Persist = "checked"/>
In this case, ifProgramTurn off, and the selected status can be restored to the previous check status when you open it next time.
However, the same method does not work on textbox .. Puzzled... A coincidence later found the problem
<Textbox id = "firsttext" Persist = "value" onchange = "This. setattribute ('value', this. Value)"/>
With the red text, persist can work normally .. Ah, you have to force the definition to change to set the value.
In addition, the persist must have an ID to take effect. Persist is followed by some attributes, including value width and so on, separated by spaces.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.