The query result of the html tag select is displayed in the drop-down menu.

Source: Internet
Author: User
The query results of the html tag select are displayed in the drop-down menu of the html select drop-down menu, for example
Value 1 Value 2 Value 3

Now the result of my query from the database is 2. how can I automatically lock the drop-down menu in "value 2" when the page is displayed?


Reply to discussion (solution)

Value 1 Value 2 Value 3
$ Value = 2;
Echo "script document. getElementById ('name'). value = $ value script";

Value 1 Value 2 Value 3
$ Value = 2;
Echo "script" docu ......
Great. problem solving

MaleFemale        
 
  
$ Value = $ list ['sex']; echo "script document. getElementById ('sex'). value = $ value script";
 


Is there any error in this place? Never

MaleFemale
 

This post was last edited by xuzuning at 11:51:14 on
PHP code? 12345MaleFemale A string is enclosed by quotation marks. variables are generated without quotation marks (js) As it turns out, there is not much knowledge about js. Thank you for your advice.

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.