A new project in the company has a very attractive feature .. it is also common on many websites. Although tags are dynamically bound with repeater and can be used with onitemcommand, this is complicated in the background and the page will be
First, let's take a look at the effect.
CopyCode The Code is as follows:
1
2
3
4
5
6
7
8
9
10
The simple method is to convert the SELECT statement into a custom style.
Currently, only two parameters can
Page tag
Backend, labelvaluebean is the internal tag of strutsVector projectitems = new vector (4 );Projectitems. Add (0, new labelvaluebean ("Project 1", "1 "));Projectitems. Add (1, new labelvaluebean ("Project Department 2", "2 "));Projectitems.
VaR OBJ = Document. getelementbyidx_x ("testselect"); // locate the ID
VaR Index = obj. selectedindex; // select an index
VaR text = obj. Options [Index]. Text; // select the text
VaR value = obj. Options [Index]. value; // The selected value.
the appearance of tags is annoying. Different browsers are inconsistent. for IE alone, a single version has a look and cannot be modified with CSS.
Here I will share my beautification Method for .Advantage: is still used. It only changes the
JQuery binds the Select tag's onchange event, pops up the selected value, and implements the jump, the argument (the value of the selected, and the value of the other elements of the page)The code is as follows:onetwothreeJQuery binds the Select tag'
The following code may be helpful to you:Copy codeThe Code is as follows:// 1. Obtain the selected option value$ ('# SelectList'). val ();// 2. Obtain the text of the selected option$ ('# SelectList: selected'). text ();// 3. Obtain multiple
The value of the select drop-down option is usually saved to the database using numbers or abbreviations. For example: male Female In this way, the record with "1" in the database indicates male, while "0" indicates female. In java files, we
Label appearance problem is very annoying, each browser is inconsistent, simply on IE, a version of a look, can not be decorated with CSS.
In this will I share the beautification method of .Advantages: Still retain the use of , only change the
In the development process, it is often used repeatedly in the Select Load Dictionary table data, such as loading jobs, education and so on, each time to use a separate acquisition and then traverse the front end will be cumbersome, and inconsistent
Select Dropdown box When selected changes, through the operation of the query string parameters, to achieve page jump, this requirement if not required to implement with Ajax, the use of a very large, mainly the operation of the URL query string
Copy Code code as follows:
var obj = document.getelementbyidx_x ("Testselect"); Positioning Idvar index = Obj.selectedindex; Select index var text = Obj.options[index].text; Selected text var value = Obj.options[index].value; Checked value
First from the server side, bind the Drop-down list, the level two drop-down of the text name according to a certain rule plus the first level Drop-down ID.
Copy Code code as follows:
var options=new Array ();
$ (document). Ready
[HTML] View plain copy one two three & nbsp;
jquery Gets the text and value of select selection
Gets the Select selected text: $ ("#ddlregtype"). Find ("option:selected"). Text ();
Gets the Select selected value: $
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.