Home >
Web Front-end >
HTML Tutorial >
Various methods to change the SELECT option of HTML drop-down box_HTML/Xhtml_Web page production
Various methods to change the SELECT option of HTML drop-down box_HTML/Xhtml_Web page production
WBOY
Release: 2016-05-16 16:40:40
Original
1992 people have browsed it
The HTML page returned after submitting the form is re-rendered. Neither the value nor selectedIndex attributes of the SELECT control can make the drop-down box retain the state before submitting the form.
Copy code
The code is as follows:
A temporary solution is to add a script at the end of the vm file to assign a value to the drop-down box :
Another solution is to set the default selected item :
Copy code
The code is as follows:
The way to write it in VTL is :
Copy the code
code As follows:
For velocity, comparisons, especially those involving inequality comparisons (greater than or less than) are relatively difficult to implement. Now I want to display the file sizes on the page in categories (Bytes, MB, GB), so it involves comparing filesize sizes. Is there a better way to achieve this? For example, the following code:
Copy the code
The code is as follows:# if ($filesize > 1024 && $filesize < 1048567)
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn