Jump to content


Photo

ECHO "<SELECT ONCHANGE=\"WINDOW.OPEN(


  • Please log in to reply
4 replies to this topic

#1 mayu_bt

mayu_bt
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 11 March 2006 - 06:23 PM

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....

#2 keeB

keeB
  • Staff Alumni
  • Advanced Member
  • 1,078 posts
  • LocationCalifornia

Posted 12 March 2006 - 07:19 AM

You have a value, but no name to reference it as.. [=

Come visit my site to see my latest projects
http://nick.stinemates.org/wordpress/


#3 hitman6003

hitman6003
  • Members
  • PipPipPip
  • Advanced Member
  • 1,807 posts

Posted 12 March 2006 - 07:29 AM

Create a js function:

<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>";


#4 keeB

keeB
  • Staff Alumni
  • Advanced Member
  • 1,078 posts
  • LocationCalifornia

Posted 12 March 2006 - 07:52 AM

[!--quoteo(post=354118:date=Mar 12 2006, 07:29 AM:name=hitman6003)--][div class=\'quotetop\']QUOTE(hitman6003 @ Mar 12 2006, 07:29 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Create a js function:

<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>";
[/quote]

Very good point hitman [=

Come visit my site to see my latest projects
http://nick.stinemates.org/wordpress/


#5 mayu_bt

mayu_bt
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 12 March 2006 - 08:46 PM

THANK you HITMAN....




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users