Insights

file type validation in javascript

function isValidfile(filename)
{

file_value = filename;
var checkfile = file_value.toLowerCase();
if (!checkfile.match(/(\.doc|\.DOC|\.pdf|\.PDF)$/))
{
return false;
}
else
{
return true;
}
}

Turn insight into action

Need help with web development or a related project?

If this article sparked an idea, question, or project direction, I can help you turn it into a practical next step.

Start a conversationChat on WhatsApp

Related reading

Articles connected to this topic

javascript

Custom Validation for Ninja Form – wordpress

Suppose you have used Ninja Form Plugin in your wordprss website. Ninja form provide you the option to validate the fields like email address, phone numbers format and required validation. But in case you have to add any custom validation then Ninja form provide you the hook to implement custom client side validation.

Jan 10, 2025

Read article

apache

401 Response when PHP-FPM Enabled on WordPress CMS

We recently migrated our website to another hosting service running FPM/FastCGI . We noticed under the website CMS -> tools -> Site Health Status , that all our REST API calls were failing authentication. It appeared to turn the request into an request from an Anonymous user even though we passed Basic Authentication h

Jan 2, 2025

Read article

css

How to find selected and unselected item in select2 dropdown

While using select2 library, if you have to find the selected and unselected item based on the change event when you check or uncheck the items. Based on the checked status, you may have to create some custom trigger or events then you can use the below code reference from codepen to achieve the save. […]

Dec 1, 2024

Read article

Most recent

Latest posts from the blog

View all articles →