Jump to content

Create Link On Fly Based On Dropdown Selection


Recommended Posts

Let's say you have the name and URL in table. Include both to your page

 

Name: dropdown

URL: Cascading dropdown

 

Add a HTML Block right after Name field and have the code below to show the link after selection

<div id="details"></div>

Add one HTML Block above URL field and paste the code below to hide cascading

<table style="display:none;"><td>

One HTML Block below URL and use the code below:

</td></table>
<script>
document.getElementsByName('InsertRecordName')[0].onblur= function (){

var URL = document.getElementsByName('InsertRecordURL')[0].value;
if (URL){
document.getElementById('details').innerHTML="<a href="+URL+">Details </a>";
}
}
</script>

Replace "InsertRecordURL" and "InsertRecordName" with the actual field names.

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...