Jump to content
  • 0

How can I pass values of the Radio button (one at a time) to an auto-submit form


Question

I hope you can help me out with this. I have a submission form (connected to a blank data source) which has 1 Virtual field. The data element of the Virtual field is 'Radio button'. I would like to save all the radio button values by passing each radio button value to another submission form (which is an auto-submit form).

 

I added this script in an  HTML block of the fist submission form. I created a button

 

<input onclick="SubmitRec()" type="submit" value="Click me" />
 
<script>
 function SubmitRec() {
     var radios = document.getElementsByName("InsertRecordcbParamVirtual1");
          for(i = 0; i < radios.length; i++) {
              val = radios.value;
               var url = "https://c2arw288.caspio.com/dp.asp?AppKey=da284000f17dcfea2642497980e7?assid=[@cbParamVirtual1];
               window.open ('url');
          }
}
     window.close()
 </script>

This script in the Footer

<script>
window.onload = function hide() {
document.getElementById("Submit").style.visibility = 'hidden';

}
</script>

 

Then I have this script in the Footer of the second submission form

<script >
  setTimeout('document.forms["caspioform"].submit()',1000);
setTimeout (window.close, 1000)

</script>

 

Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Are you trying to send all options you have as radio button one by one to another submission page to add one row for each option?

Or you want to only pass the value of the selected one? what is the purpose of this? As you may know for radio buttons you can only select one option.

To autosubmit and hide a form you need to use the code provided here in a HTML Block added at the very end of element list in submission page:

 

Link to post
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...
×
×
  • Create New...