/    Sign up×
Community /Pin to ProfileBookmark

How to open page when i click on Option values

Hi,

In my application i am using Dropdown option values. when i click on one of the option values it will open a page. I am using following code. It shows errors. Could you please help on this one ??

[code]
<select name=CATEGORY class=selInput>” );

<option value=”#”> —————- </option>
[b] <option value=”ozSetupOptValues.jsp?id=SLS_CUSTOMER_CATEGORY”> manage accounts</option> [/b] // in this line it gives problem
</select>
[code]

thanks in advance….

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@Sterling_IsfineApr 17.2009 — You haven't shown any JavaScript code.
Copy linkTweet thisAlerts:
@AdusumalliauthorApr 17.2009 — actually I have drop down list in my form. In my dropdown i have 5-6 values . when i click on the specific value , which i mentioned above post (Manage Accounts) it will go to that jsp page. so what i need to update in option value to call that JSP. ??
Copy linkTweet thisAlerts:
@JMRKERApr 17.2009 — Try this:
<i>
</i>&lt;select name=CATEGORY class=selInput onchange="document.location.href=this.value"&gt;

&lt;option value="#"&gt; ---------------- &lt;/option&gt;
&lt;option value="ozSetupOptValues.jsp?id=SLS_CUSTOMER_CATEGORY"&gt; manage accounts&lt;/option&gt; // in this line it gives problem
&lt;/select&gt;
Copy linkTweet thisAlerts:
@AdusumalliauthorApr 17.2009 — hi thanks for reply. I have 5-6 fields in drop down. But when i click on "ManageAccount" option they only it should invoke. I tried in the following way.

<i>
</i> &lt;select name=CATEGORY class=selInput onchange="onChange=go();"&gt;
&lt;option value="sample1"&gt;sample1&lt;/option&gt;
&lt;option value="sample2"&gt;sample2&lt;/option&gt;
&lt;option value="#"&gt; ---------------- &lt;/option&gt;
&lt;option value="manageaccount"&gt; manage accounts&lt;/option&gt;
&lt;/select&gt;

&lt;head&gt;
&lt;script&gt;
function go() {
window.location = "ozSetupOptValues.jsp?id=SLS_CUSTOMER_CATEGORY";
}
&lt;/script&gt;
&lt;/head&gt;


it is calling the JSP when i choose every option. But i need to invoke the JSP when i choose "Manage Accounts" only.

Thanks
Copy linkTweet thisAlerts:
@JMRKERApr 17.2009 — Try this:
<i>
</i> &lt;select name="CATEGORY" class="selInput" onchange="if (this.selectedIndex == 3) { go(); }"&gt;
×

Success!

Help @Adusumalli spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...