Realize
The first type of PHP drop-down box implementation method:
- < ? PHP
- Submit drop-down box;
- The result of a direct full trigger onchange event
- $ ID =$_get[' myselect ';//Myselect
For the name of Location.herf?id;
- echo $id;
- The results submitted using the form;
- if ($_post["Sendselect"]) {//sendselect is the name of the form;
- $ Select_val =$_post["Selectid"];
- echo "The value you have chosen is: $select _val";
- }
- Print_r ($_post);
- $ Xing = "Xing" ;
- $ Fang = "Fang" ;
- Echo ' < a href=del_03. php? ID = '. $xing. '
&action='. $fang. ' > FLX < /A > ';
- PHP, in the deletion of content, the wording of the hints given; The href must be appended with quotation marks;
- echo "n". " < input type=' button '
value=' delete ' onclick= ' if (Confirm (' OK to delete '))
{ location.href='? delete= $result _manage[p_id] '} '>
- < br>< br>";
- }
- echo " < input type=' button ' value =' Connect_next '
onclick = "Location.href = ' del_03.php?id=
$xing &action= $fang '>';
- ?>
The second type of PHP drop-down box selection implementation method:
- < input type = "button" value = "Delete" onclick="
if (Confirm (' OK to delete ')) location.href=
' del_03.php?id=xing '>< br/>
- < script language = "JavaScript" type = "Text/javascript">
- function Select (obj) {
- window.location.href = ' del_04.php?myselect=
'+obj.options[obj.selectedindex].value;
- Return Can not write;
- }
- < /script >
- < input type = "button" value = "delete"
onclick = "if (confirm (' OK to delete '))
location.href= ' del_03.php?id=xing ' " > < br />
- < form name = "MyForm" action = "Del_04.php"
Method = "POST" >
- < !--trigger The onchange event directly without submitting the form,-- >
- < !-- < Select name = "Selectid" onchange =
"Location= ' del_04.php?myselect= ' +this.options
[This.selectedindex].value]>-->
- < !--Write the onchange event in a function-- >
- < Select name = "Selectid" onchange = "SELECT (This)">
- < !-- < Select name="Selectid" > -->
- < option value = "0" > Please select < /option >
- < option value="value1"> Option1< /option>
- < option value="value2">option2 < /option>
- < option value="value3"> Option3< /option>
- < /select >
- < input type="Submit" name=" Sendselect "
value = "Submit drop-down box" />
- < /form >
The above is the PHP drop-down box two implementation methods are introduced.
http://www.bkjia.com/PHPjc/445968.html www.bkjia.com true http://www.bkjia.com/PHPjc/445968.html techarticle Implementation of the first PHP drop-down box implementation method:? PHP//Submit drop-down box;//Direct full trigger onchange Event results $ id =$_get[' myselect '];//myselect for location.herf?id name; echo$ I ...