Jump to content

How To Redirect User To The Selected Value From The Dropdown


Recommended Posts

  • 1 year later...

Insert code into the footer of the DataPage

 



<script type="text/javascript">
v_a = document.getElementById('YOURFIELDID');
if (v_a){
v_a.onchange = function(){
v_a = document.getElementById('YOURFIELDID');
document.location = v_a.options[v_a.options.selectedIndex].value;
}
}
</script>


And replace YOURFIELDID with correct dropdown field id.

 


So if you insert this JS in to the Footer of your DataPage and select some value in the dropdown (YOURFIELDID should be replaced with dropdown id), you will be redirected to the selected value (correct URLs should be used as dropdown values).

 

NOTE: This JS doesn't work in the DataPage Preview and iFrame deployment because of iFrame security

Link to comment
Share on other sites

  • 1 month later...

I have a details datapage with a dropdown to select a single customer, and also have a multi-select listbox to choose a range of similar customers for comparison (the customers are sorted in ascending order by revenue).

 

I would like to have my listbox set the focus on the customer selected in the dropdown, so the user will not need to scroll through the entire list.

 

I saw this JS and tried messing with it to see if it could be modified to set the focus when selecting the dropdown, but it does not work that way.  Can this even be done in JS or should I just figure out another way?

 

Thanks in advance.

 

ET

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...