Skip to main content

Notifications

Community site session details

Community site session details

Session Id : Xb7HK9NR0Njks28ytNOxAy
Power Pages - General Discussions
Unanswered

Making a File column mandatory in multistep form

Like (0) ShareShare
ReportReport
Posted on 6 Dec 2023 15:13:10 by 309

Hi,

 

We added two file columns on the Account table and exposed them in a step in the multistep form. We want to make these file columns mandatory but the metadata attribute drop down does not list file columns. How do I make them mandatory in the multistep form -

 

prathyoo_0-1701875506708.png

 

The first two "Choose File" maps to Account columns and the third "Choose Files" uses the Notes entity to store multiple other files.

 

Prathyoo

Categories:
  • Surendran Ravindran Profile Picture
    212 on 11 Dec 2023 at 11:20:19
    Re: Making a File column mandatory in multistep form

    @prathyoo 

    Yes , it works similar.

     

    -----------

    If the above post solves your problem, please mark it as solution.

  • psreek Profile Picture
    309 on 11 Dec 2023 at 11:06:04
    Re: Making a File column mandatory in multistep form

    Thanks. I resolved this similar to your solution. I set Required property of the two file columns to 'Business Recommended'. Then in the 'Document' step of the multistep form I updated the following property to 'Yes'

     

    prathyoo_0-1702290200723.png

    prathyoo_1-1702290303546.png

     

    And now the file columns are mandatory in the form. I see that this generates a javascript to carry out the validation. Can you also confirm that the validation also occurs at the server side if someone were to play with the js on the browser.

  • Surendran Ravindran Profile Picture
    212 on 09 Dec 2023 at 08:41:04
    Re: Making a File column mandatory in multistep form

    Hi @prathyoo ,

     

    Method 1

    •  Make it as Bussiness Required in column setting

    Surendran_R_0-1702110553596.png

     

    Method 2:

    Add below java script in Form Step 

     

    Example : Note*  --> make changes based on your the field name/id

     

    $(document).ready(function(){
    //Replace Next with actual id of Next button
     $("#Next").click(function(){
    
     var fileInput = document.getElementById("fileInput"); 
    //Change fileInput with actual id of file field
    
     // Check if a file is selected
     if (fileInput.files.length === 0) {
     alert("Please select a file.");
     event.preventDefault(); // Prevent form submission
     }
     
     });
    });

     

    Regards

    Surendran Ravindran

     

    --------------------------------------------------------------------------------------

    Hope that helps.

    If the post solves your problem, please mark it as solution. If it helps, consider a thumbs up.

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Pages - General Discussions

#1
WarrenBelz Profile Picture

WarrenBelz 9 Most Valuable Professional

#2
Fubar Profile Picture

Fubar 6 Super User 2025 Season 1

#2
Rondel Profile Picture

Rondel 6

Overall leaderboard
Loading started