-
April 16th, 2009, 05:59 PM
#1
[RESOLVED] 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>
<option value="ozSetupOptValues.jsp?id=SLS_CUSTOMER_CATEGORY"> manage accounts</option> // in this line it gives problem
</select>
thanks in advance....
Last edited by PeejAvery; April 16th, 2009 at 08:31 PM.
Reason: Fixed code tags.
-
April 16th, 2009, 08:32 PM
#2
Re: How to open page when i click on Option values
This is a very simple task. Any Google search could have given you the answer. There's even one on this very page called "Forum Jump."
Code:
<select onchange="window.location=this.value">
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
April 17th, 2009, 10:55 AM
#3
Re: How to open page when i click on Option values
In my dropdown i have 5-6 values. But i want to go that link(ozSetupOptValues.jsp?id=SLS_CUSTOMER_CATEGORY") when i choose that specific value , which i mentioned above (Manage Accounts).
thanks
-
April 17th, 2009, 11:48 AM
#4
Re: How to open page when i click on Option values
Look back at my previous post. I already gave you the answer!
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
April 17th, 2009, 03:32 PM
#5
Re: How to open page when i click on Option values
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.
Code:
<select name=CATEGORY class=selInput onchange="onChange=go();">
<option value="sample1">sample1</option>
<option value="sample2">sample2</option>
<option value=\"#\"> ---------------- </option>
<option value="manageaccount"> manage accounts</option>
</select>
<head>
<script>
function go() {
window.location = "ozSetupOptValues.jsp?id=SLS_CUSTOMER_CATEGORY";
}
</script>
</head>
It is calling the JS function when i choose every option. But i need to invoke the JSP when i choose "Manage Accounts" only. Can you an idea on this ??
thanks ..
-
April 17th, 2009, 03:46 PM
#6
Re: How to open page when i click on Option values
So you need to pass this as a parameter of the go() function. From within the function, you can check the value of the selected item of the <select> tag but using the parameter.
Code:
<script type="text/javascript">
function go(select) {
if (select.value == 'manageaccount') {window.location = 'ozSetupOptValues.jsp?id=SLS_CUSTOMER_CATEGORY';}
}
</script>
<select name="CATEGORY" class="selInput" onchange="go(this)">
<option value="sample1">sample1</option>
<option value="sample2">sample2</option>
<option value=\"#\"> ---------------- </option>
<option value="manageaccount"> manage accounts</option>
</select>
This really is very basic JavaScript. I highly suggest that you read up on some tutorials before proceeding and doing more scripting!
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
April 17th, 2009, 04:52 PM
#7
Re: How to open page when i click on Option values
It's not working. It is enter into the go() . but the JSP is not invoking at any time.
Last edited by adusumalli; April 17th, 2009 at 04:55 PM.
-
April 17th, 2009, 05:13 PM
#8
Re: How to open page when i click on Option values
The code is correct, the problem must be with your JSP name or context.
Change select var name to something else, this is a reserved word, some browsers may have trouble understanding it.
Last edited by Xeel; April 17th, 2009 at 05:17 PM.
Wanna install linux on a vacuum cleaner. Could anyone tell me which distro sucks better?
I had a nightmare last night. I was dreaming that I’m 64-bit and my blanket is 32-bit and I couldn’t cover myself with it, so I’ve spent the whole night freezing. And in the morning I find that my blanket just had fallen off the bed. =S (from: bash.org.ru)
//always looking for job opportunities in AU/NZ/US/CA/Europe :P
willCodeForFood(Arrays.asList("Java","PHP","C++","bash","Assembler","XML","XHTML","CSS","JS","PL/SQL"));
USE [code] TAGS! Read this FAQ if you are new here. If this post was helpful, please rate it!
-
April 17th, 2009, 05:36 PM
#9
Re: How to open page when i click on Option values
Now it's getting. thanks.
Last edited by adusumalli; April 17th, 2009 at 05:41 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|