0

I have a scenario where users are to book sessions with date and time. Currently, I am trying two ways to enforce unique values for date and time.

I added a date picker. I added a formula to validate the date to be only Fridays. But I need the time to be customized such as only time are shown e.g. 2:30 or 3:30 or 4:30 to be selected from. If I can customize it in such a way, I can enforce unique values easily.

If not, I have created 2 columns; date picker with date only and time as a drop-down choice. But how can I enforce 2 columns to be a unique value?

Kindly advise, I am open to suggestions

JavaScript:

enter image description here

HTML:

enter image description here

3
  • 1
    While using Date and Time column, you can hide some options from time drop-down control using javascript on list forms. – Ganesh Sanap Jul 25 '19 at 4:51
  • Oh i see, I tried getting codes from online but it is not working – sangasangasanga Jul 25 '19 at 6:45
  • I added the codes and screenshot to the question – sangasangasanga Jul 25 '19 at 7:22
0

Try something like this:

<script>
    $(document).ready(function() {
        $("select[id$='DateTimeFieldDateMinutes']").children("option[value='00']").hide();
    });
</script>

Here $ shows that ID of select Ends With specified value DateTimeFieldDateMinutes.

Also, you can add completed ID for drop-down selector(Add selector carefully to get the particular element only):

<script>
    $(document).ready(function() {
        $("#selectID").children("option[value='00']").hide();
    });
</script>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.