Jump to content

Recommended Posts

Hi there,

 

I have the following code in a submission form:

 

<script>
window.onload=function(){
if (document.getElementById("InsertRecordPalmas").checked)
{var new_value = "Palmas";}
else
{var new_value = "AAA";}
 
document.getElementById("cbParamVirtual1").value=new_value;
 
}
</script>
 
This code puts a certain value on Virtual1 (which is a TextBox) depending on whether Palmas Check Box is checked or not. It works perfectly, but it stops working when I turn the Submission Form into a Detail Report. I know is not the "onload" because I tested it without the if statement and it works, so I'm guessing it has to do with the way I'm referencing or calling Palmas Check Box.
 
Does anyone knows why is the if statement behaving differently when the Submission Form is changed to a Detail Report? Thanks!
Link to comment
Share on other sites

Hi MostlyJava,

 

As far as I know, the InsertRecord prefix is used on Submission Forms, on Details and Single Update Forms the EditRecord prefis is used.

You can change the Id InsertRecordPalmas to EditRecordPalmas.

 

You can find more details about names etc. in a guideline for referencing Caspio form elements using JavaScript.

 

I hope, it helps!

Link to comment
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
Reply to this topic...

×   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...