kytan5 Posted November 26, 2016 Report Share Posted November 26, 2016 Hi Hope someone can help me out here with my javascript problem. I have a submission form (which is multi-step form, 2nd page of a form which is now a update form) which is collecting information like project type, project name, description. It is cascading from project type -> project name -> description Because I can't do a cascading text area for "description". I have created a virtual text field for this value hoping to copy this into the "description" text area. I am having no luck with javscript which I have modify from what i found on this forum. Can someone please help me? This is what I have came up with. <script type="text/javascript"> // Caspio form elements var description = document.getElementById('EditRecordDescription'); var temp_description = getElementsByName("cbParamVirtual1")[0].value; var caspioForm = document.getElementById('caspioform'); // Event handler var Copy = function () { // TODO: assign value to description field description.innerHTML = temp_description; } document.getElementById("caspioform").onload= Copy; </script> Quote Link to comment Share on other sites More sharing options...
LWSChad Posted December 22, 2016 Report Share Posted December 22, 2016 I can't tell when you want the data copied based on your question, so I'll try to help, assuming you want the description copied after the user types a description. <script> var caspioDescriptionElement = document.getElementById('EditRecordDescription'); var formDescriptionElement = document.getElementById("cbParamVirtual1"); formDescriptionElement.onchange = function() { caspioDescriptionElement.value = formDescriptionElement.value; } </script> While writing this, I noticed that you're missing a "document" before "getElementsByName("cbParamVirtual1")[0].value; ". That might fix your code. Quote Link to comment Share on other sites More sharing options...
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.