Hello i am making <select>
drop down menu and trying to make it so when someone clicks on one of the option of drop down it will open new window and at same time while clicking on option PHP variable of main page should pass to that new window
Could any one tell me where am i wrong, here's my code-
<div class='fieldgroup'>
<label for=@label>@label</label>
<select name="@label" title="select optin" style="cursor:pointer;cursor:hand;text-align:center;font-weight:bold;float: left;margin: 10px 0px 0px 0px;height: 25px;">
<option>@option1</option>
<option <a href="#" onclick="window.open('@newwindow.php?@value=<?$@value?>','newWindow','width=800,height=600,left=150,top=200,toolbar=no,addressbar=yes,resizable=false');"></a>>@option2</option>
<option>@optin3</option>
<option>@optin3</option>
<option>@option4</option>
</select>
</div>
Focus on what it really is: A HTML/Javascript problem. It has nothing to do with PHP. Try going step by step:
This way you will learn a lot about how things work and what action happens in which world (HTML, Javascript, PHP).
您不能在选项内使用A标记,类似这样的方法应该起作用:
<select onChange=" window.open('yoururl.php?value=' + this.options[this.selectedIndex]);">
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.