I have a submission form with a popup link. The form has a Job dropdown element that is being used as a parameter to pass to the popup. When a Job is selected from the dropdown and the popup link is clicked, a List Report pops up and shows records related to the Job that was selected.
This works great. However, I need an element in the form to be cascading, and the Job dropdown has to be the parent field for this.
When I enable the cascading feature, my popup stops working. I get an Uncaught TypeError of null, stating that the parameter field name cannot be found. So, Job can be found before it is made a parent field for a cascading element, but once it is made the parent field, it stops working.
Here is my code.
<script>var fieldName ="Job";// The name of your table field.var paramName ="Job";// The name of your parameter/* No modifications necessary beyond this line */var inputField = document.querySelector('[action*="[@cbAppKey]"] #InsertRecord'+ fieldName);var linkToChild = document.querySelector('[action*="[@cbAppKey]"] #linkToChild');var baseUrl = linkToChild.href;//do not touchvar moddedUrl = baseUrl;//do not touchfunction updateLink(){
moddedUrl =`${baseUrl}?${paramName}=${this.value}`}['change','keydown','keyup'].forEach(function(e){
inputField.addEventListener(e, updateLink);});
inputField.dispatchEvent(newEvent('change'));
linkToChild.onclick =function(){
window.open(moddedUrl,'','resizable=no,status=no,location=no,toolbar=no,menubar=no,fullscreen=no,scrollbars=no,dependent=no');returnfalse;}</script>
Any help would be appreciated. This is maddening me, haha.
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.
Question
kpcollier
Hello.
I have a submission form with a popup link. The form has a Job dropdown element that is being used as a parameter to pass to the popup. When a Job is selected from the dropdown and the popup link is clicked, a List Report pops up and shows records related to the Job that was selected.
This works great. However, I need an element in the form to be cascading, and the Job dropdown has to be the parent field for this.
When I enable the cascading feature, my popup stops working. I get an Uncaught TypeError of null, stating that the parameter field name cannot be found. So, Job can be found before it is made a parent field for a cascading element, but once it is made the parent field, it stops working.
Here is my code.
Any help would be appreciated. This is maddening me, haha.
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
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.