Jump to content
  • 0

Collapsible Sections on Form: all start closed or top one open?


roattw
 Share

Question

I was able to implement the collapsible sections using the Caspio How To.  However, the sections all start in the open state.  I would like them to open in the closed state, or better yest just the first one open.

Thed instructionsz say "By default, all of the sections we created will be hidden. You can change a section’s default visibility by setting the HTML table’s style attribute to “display:inline;” instead of “display:none;”."  But mine are not opening closed by default.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

This is what I use. The sections are closed when you open the page. 

Do this for each section. If you want the first one to be opened when you first open the page, just get rid of the style="display:none" on the opening HTML block.

HTML Block at beginning of section, enter this.

<input type="button" onClick="Displayer(1)"
value="Receiving Info"><br>

<style>
button styling
</style>

<table id="Section1" style="display:none;"><td>

HTML Block at the end of section, enter this.

</td></table>

With this little script in the footer

<script>
function Displayer(n)
{
var check = document.getElementById('Section'+n);
if(check.style.display == 'none')
{
check.style.display='inline';
}
else
{
check.style.display='none';
}
}
</script>

 

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

×
×
  • Create New...