Dropdown with URL in onchange

If you want to create a dropdown list with onchange event to dynamically go to selected URL then do this:

Use Sharepoint Designer
Insert Data View
Select Show Data
Select which field that should be displayed in the drop-down list
Insert Data
ViewData..
Style
Change layout to “Drop-down view style”
Click OK
Change to Code view in Designer
Put the following code before the /head> tag:

script language=”JavaScript”>

/script>

Then find the following in your code
select name=”ID” size=”1″12
Change that to
select name=”ID” size=”1″ onchange=”FP_jumpMenu(this,’window’,false)”>

Then find
option style=”display:{$GroupStyle}”
Change to
option style=”display:{$GroupStyle}” value=”{@FieldWithURL}”>
where FieldWithURL is the link that you want to go to
Save

Share this blog post:

2
Leave a Reply

avatar
2 Comment threads
0 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
1 Comment authors
jeaLise Recent comment authors

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  Subscribe  
newest oldest most voted
Notify of
Lise
Guest

Hi!
Could you please supply your code and I will have a look?
It was a long time ago I tried that out, and dont think I have my old default.aspx page left. But I’ll have a look at yours if you like.
Take care,
/Lise

jea
Guest

I haven’t had any luck with associating your code with a typical sharepoint designer dropdown list. Can you provide the actual design view code?

Thanks,
Jim.e.althoff@ssa.govpredicar