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.

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.