Validate Dropdown list

Discussion in 'LiquidFiles General' started by Lance L, Jan 28, 2021.

  1. Lance L

    Lance L New Member

    Joined:
    Jan 12, 2019
    Messages:
    5
    Likes Received:
    0
    Hi all,

    I had an issue that I solved and wanted to share. On one of my Filedrops, I had a drop down list that wasn't being being validated even though it was marked as required. There are lots of clever ways around this, but since I wanted every custom field answered, I did this. Make sure your first selections is an empty quote.

    This is the custom field:
    Software Version: select("","QuickBooks 2021- All Versions except Enterprise", "QuickBooks 2020- All Versions except Enterprise", "QuickBooks 2019- All Versions except Enterprise", "-----", "QuickBooks Enterprise 21", "QuickBooks Enterprise 20", "QuickBooks Enterprise 19",-----", "OLD QuickBooks Version - Anything older than 3 years will incur conversion charges",-----", "Sage 50 - Current Version"), required

    To make all fields required, I added this to the Custom Javascript section:
    $(function() {
    if (select == "") {
    alert("Please select a selection");
    return false;
    });

    This also helped by helping the user not to forget to select Whom to send the file to since it would also be validated.

    Example:
    Send files to: select("","John Doe","Curtis Somebody","Other Staff"), class("col-sm-4"), required

    [​IMG]

    [​IMG]

    Maybe this is in the docs, maybe this is a known thing. I don't know.
    I don't do much programming and it was a simple fix for me and helped out by eliminating unchosen answers on a form.

    Hope this helps someone..
    Lance
     
    #1 Lance L, Jan 28, 2021
    Last edited: Jan 28, 2021

Share This Page