Jump to content
  • 0

Disable option in dropdown


imJihyo

Question

Hi! I have a submission form that contains a dropdown field. In this dropdown field, I have included a dummy option or maybe a placeholder(?)  The options are:

  • Choose one
  • True
  • False

Since "choose one" option is just a dummy option, I want my users to not be able to choose it. Is there any way I can disable it? I believe this can't be done using standard feature. Any help will be gladly appreciated. :)

- Jihyo ♥

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hi @imJihyo,

Yes, unfortunately, this can't be done through standard features as we cannot edit the HTML tag of the options through DataPage Settings. We may use JavaScript for this one, though.

Please change the id 'InsertRecordTitle' to your proper field ID

 

Quote

 

<script>
document.addEventListener('DataPageReady', function (event) {

document.getElementById('InsertRecordTitle').options[0].disabled = true;

});
</script>

 

This basically takes the first option 'options[0]'  and disables it 'disabled=true' so it cannot be selected.

 

Here's a demo if you want to see
https://c2aby549.caspio.com/dp/83ff800094602015e823413f839a

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