PHP text box

Source: Internet
Author: User
PHP text box problems have just been learned, PHP, encountered a lot of problems, please kindly help solve! 1. value = & quot; content & quot; already exists in the text box. how can I click a button to clear the content in the text box or use other content to replace the existing content. how can I select another PHP text box in a drop-down menu?
I just learned PHP and encountered many problems. please help me solve them!

1. the text box already contains value = "content". how can I click a button to clear the content in the text box or use other content to replace the existing content?

2. how to select a value from a drop-down menu? the corresponding content will be displayed in the other text box.
For example, when selecting 1, the text box displays 2
When selecting 2, the text box displays 2

Please kindly advise. if you have any code, send one.

------ Solution --------------------
It should be a javascript issue.
------ Solution --------------------


------------------------------
Document. getElementById ('test'). value = 'empty content box '; // clear
------ Solution --------------------
Function delSearch (svalue) {// reloads the window if Nav4 resized
Var searchkey = document. getElementById ("searchKey ");
If (searchkey. value = svalue ){
Searchkey. value = '';
}
}
------ Solution --------------------
Js implementation
------ Solution --------------------
... There is a button in the html for clearing.
HTML code

------ Solution --------------------
Discussion
... There is a button in the html for clearing.

HTML code





2nd people forget how code is represented,

You only need to assign the value from the drop-down box to the php text box, and then display the text box.

------ Solution --------------------
..........
------ Solution --------------------
Discussion
Function delSearch (svalue) {// reloads the window if Nav4 resized
Var searchkey = document. getElementById ("searchKey ");
If (searchkey. value = svalue ){
Searchkey. value = '';
}
}

------ Solution --------------------
Onclick = "reset ()"

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.