mayu_bt Posted March 11, 2006 Share Posted March 11, 2006 Hi Learned people,I am using the below syntax to have popup window popping up when I select the option in the dropdown.echo "<select onchange=\"window.open('breaktype.php?username= ', 'Edituser', 'width=500,height=400,scrollbars=1')\">";echo "<option>--Select--</option>";echo "<option value='C'>Coffee</option>";echo "<option value='F'>Fag</option>";echo "<option value='L'>Lunch</option>";echo "<option value='O'>Others</option>";echo "</select>";How to pass the value selected from the drop down to the popup in the above syntax? if I mention this.option it takes the valuse as "this.option" itself!! but not the value selected in the dropdown... PLEASE HELP....POPUP window is popping up fine with the above syntax.. the problem is passing the value selected in the dropdown.... Quote Link to comment https://forums.phpfreaks.com/topic/4698-echo/ Share on other sites More sharing options...
keeB Posted March 12, 2006 Share Posted March 12, 2006 You have a value, but no name to reference it as.. [= Quote Link to comment https://forums.phpfreaks.com/topic/4698-echo/#findComment-16603 Share on other sites More sharing options...
hitman6003 Posted March 12, 2006 Share Posted March 12, 2006 Create a js function:[code]<script type="text/javascript">function selectpops(a) { var value = a.selectedIndex.value; var win = window.open("breaktype.php?value=" + value, 'Edituser', 'width=500,height=400,scrollbars=1');}</script>echo "<select onchange=\"selectpops(this)\">";echo "<option>--Select--</option>";echo "<option value='C'>Coffee</option>";echo "<option value='F'>Fag</option>";echo "<option value='L'>Lunch</option>";echo "<option value='O'>Others</option>";echo "</select>";[/code] Quote Link to comment https://forums.phpfreaks.com/topic/4698-echo/#findComment-16605 Share on other sites More sharing options...
keeB Posted March 12, 2006 Share Posted March 12, 2006 [!--quoteo(post=354118:date=Mar 12 2006, 07:29 AM:name=hitman6003)--][div class=\'quotetop\']QUOTE(hitman6003 @ Mar 12 2006, 07:29 AM) [snapback]354118[/snapback][/div][div class=\'quotemain\'][!--quotec--]Create a js function:[code]<script type="text/javascript">function selectpops(a) { var value = a.selectedIndex.value; var win = window.open("breaktype.php?value=" + value, 'Edituser', 'width=500,height=400,scrollbars=1');}</script>echo "<select onchange=\"selectpops(this)\">";echo "<option>--Select--</option>";echo "<option value='C'>Coffee</option>";echo "<option value='F'>Fag</option>";echo "<option value='L'>Lunch</option>";echo "<option value='O'>Others</option>";echo "</select>";[/code][/quote]Very good point hitman [= Quote Link to comment https://forums.phpfreaks.com/topic/4698-echo/#findComment-16608 Share on other sites More sharing options...
mayu_bt Posted March 12, 2006 Author Share Posted March 12, 2006 THANK you HITMAN.... Quote Link to comment https://forums.phpfreaks.com/topic/4698-echo/#findComment-16779 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.