0

i have the code in my project-

<Script language="JavaScript">
function goto(form) { var index=form.select.selectedIndex
if (form.select.options[index].value != "0") {
location=form.select.options[index].value;}}
</SCRIPT>
<FORM NAME="form1">
<SELECT NAME="select" ONCHANGE="goto(this.form)" SIZE="1">
<OPTION VALUE="">-------Choose a Purpose-------
<OPTION VALUE="<?php echo base_url()."admin_panel/post_pmb/project"; ?>">Project Discussion </option>
<OPTION SELECT="SELECTED" VALUE="<?php echo base_url()."admin_panel/post_pmb/general"; ?>">General Discussion</option>
</SELECT>
</FORM>

in this code the select="selected" element is not working.

2
Contributors
1
Reply
4
Views
5 Years
Discussion Span
Last Post by niranga
0

I changed your URLs into Google and Facebook, just to make sure other parts are working and it worked.

<script language="JavaScript">
    function goto(form)
    {
        var index=form.select.selectedIndex
        if (form.select.options[index].value != "0")
        {
            location=form.select.options[index].value;
        }
    }
</script>
<FORM NAME="form1">
    <SELECT NAME="select" ONCHANGE="goto(this.form)" SIZE="1">
        <OPTION VALUE="">-------Choose a Purpose-------
        <OPTION VALUE="http://www.google.com">Google</option>
        <OPTION SELECT="SELECTED" VALUE="http://www.facebook.com">Facebook</option>
    </SELECT>
</FORM>

Check whether <?php echo base_url()."admin_panel/post_pmb/project"; ?> and <?php echo base_url()."admin_panel/post_pmb/general"; ?> gives what you want

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.