693 Posts
rpoy
5 years ago
Topic

Hi Everyone!

I have a search form with a Select Dynamic Cascade field which displays a field from a category - works great!  In another text field (EN_Name), there is a conditional set up which copies the category name to the field.

So the problem is that the value of the ID is added to the EN_Name.   What I need to be copied is the Display value in the SDC field.  Is there an attribute that can be set in the conditional?  Or do I need some javascript copy the innertext to EN_Name.  But not sure exactly how or what the best method to achieve this.

Any thoughts would be great.

thanks

Get a VIP membership
693 Posts
rpoy
5 years ago
1
Level 1

Hey Everyone!

I was able to solve this by adding an onclick event to the cascade field and defining the function in a field using the Javascript Codepack:

document.getElementById("en_cascade_cat").onclick= function() {setEn()};


function setEn(){
var e = document.getElementById("en_cascade_cat");
var sEn= e.options[e.selectedIndex].text;

document.getElementById("en_name").value=sEn;
}

thanks,

1283 Posts
Bucklash
5 years ago
0
Level 2

Nice

Thanks for sharing that with the communyiy :D

Get a VIP membership