I am hoping someone can help me with some JavaScript. I know I'm on the right track but there seems to be something that I'm missing.
I have a collection (class = addendums) that contains a single line field and a blank custom html field in each set. The single line field (#q95) is being populated with a URL from a Lookup Rule. I am using JS to insert the URL as an iframe into the custom html field (#q96). I have successfully implemented this method before but it was not inside a collection. Right now, it is working for the first set, but not the subsequent sets. I was thinking the .each would take care of that but no luck so far.
This code is inside the $(document).ready function.
//Insert the iframe stuff into the html field function loadAddendums(){ $('.addendums .rpx').each(function(){ var urlA = $('#q95 input').val() var fullhtmlA = "<iframe id='myframe' src='" + urlA + "' width='100%' height='600px'></iframe>"; document.getElementById("q96").innerHTML = fullhtmlA; }) } //Execute the iframe function whenever the collection field changes $('.addendums').change(loadAddendums);
The URL field will eventually be hidden... it is visible for now while I am testing.