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 ()"