Jump to content
  • 0

Displaying A Url From A Cascading Dropdown


egilley
 Share

Question

I'm trying to display the results of a cascading dropdown box.

 

In an HTML block, this seemed to me like the simplest of tests:

 

 
<script type="text/javascript">
 
clientweb = document.getElementsByName("InsertRecordCustomer_URL")[0]
 
document.write(clientweb)
 
</script>

 

 

but I'm getting this:

 

[object HTMLSelectElement]

 

Also, once I get the value of the field to display, I plan to make it a clickable URL - would appreciate any input on that, but I'm not even there yet, still just trying to just access the data!

 

Help please?

 

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

Thanks, but that didn't work either.  After hours of struggling with this silly syntax, I called Support and she pointed out that I needed a function to call the cascade dropdown after it populates.  So she tried this...

 

<script>
var clientweb;
 
function test(){
 
var clientweb = document.getElementsByName("InsertRecordCustomer_URL")[0].value;
 
}
 
document.getElementsByName("InsertRecordCustomer_URL")[0].onchange=test;
 
</script>
 
 
But still could not get a working URL to display on the page.  She's going to email me ... eventually, LOL.
 
I can't believe how many hours I have struggled over this tiny, tiny item!
Link to comment
Share on other sites

  • 0

I took what she sent me and made a couple tweaks - and it worked, YAAAAAY!!

 

In case anyone is interested, here is the script (inside an HTML block) that worked:

 

 

 

<p id="demo"></p>
<script>
 
function test(){
 
var t1=document.getElementsByName("InsertRecordCustomer_URL")[0].value;
 
str="CUSTOMER URL";
var result=str.link(t1);
 
document.getElementById("demo").innerHTML=result;
    
}
 
document.getElementsByName("InsertRecordCustomer_URL")[0].onchange=test;
 
</script>
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
Answer this question...

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

×
×
  • Create New...