Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 830503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T04:03:17+00:00 2026-05-15T04:03:17+00:00

<input id=’btnExcelRead’ name=’btnExcelRead’ type=’submit’ runat=’server’/> <- actually asp:button <input id=’excelUpload’ name=’excelUpload’ type=’file’ /> <input

  • 0
<input id='btnExcelRead' name='btnExcelRead' type='submit' runat='server'/>   <- actually asp:button
<input id='excelUpload' name='excelUpload' type='file' />   
<input id='txtStartDate' type='text' />
<input id='txtEndDate' type='text' />

..

$(function(){

          $("#btnExcelRead").click(CheckValidation);

        });

        var CheckValidation = function() {
            if ($("#excelUpload").val() === "") {
                alert("Select file");
                return false;
            }
            if ($("$txtStartDate").val() === "") {
                alert("Check the start date!");
                return false;
            }
            if ($("$txtEndDate").val() === "") {
                alert("Check the end date!");
                return false;
            }
        }

here i made simple jquery code.

I want to bind function when btnExcelRead button click.

is this originally wrong way?

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T04:03:17+00:00Added an answer on May 15, 2026 at 4:03 am

    What you have is valid, aside from the selectors, I would reformat is a bit, like this:

    $(function(){
          $("#btnExcelRead").click(CheckValidation);
    });
    
    function CheckValidation () {
        if ($("#excelUpload").val() === "") {
            alert("Select file");
            return false;
        }
        if ($("#txtStartDate").val() === "") {
            alert("Check the start date!");
            return false;
        }
        if ($("#txtEndDate").val() === "") {
            alert("Check the end date!");
            return false;
        }
    }
    

    You can see a demo of it working here

    You have $txtStartDate and $txtEndDate for your selectors, I think you meant #txtStartDate and #txtEndDate here (I assume you’re finding them by ID). Also if you want a named function, just make one 🙂 If you store a variable pointing to a anonymous function, make sure to put a ; after it, since that’s a statement.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

input type=button name=colr value= Blue onclick=document.bgColor='#0000FF' Basically i have done buttons using javascipt to
input type file or the file upload html control/ asp.net control value seems to
Input values <input type=hidden name=service_row[1]['row'] value=1 /> <input type=checkbox name=service_row[1]['check'] /> <input type=text name=service_row[1]['observation']
Input: I have a LaTeX file, with plain text & math formulas. Desired output:
Input file text.txt: foo() { } buz() { } Awk script.awk : BEGIN {
input field with type file used for browsing file .How to make it for
input type=text/radio/checkbox - can I treat them differently in my CSS? Other than by
Input: List of keys: [ :name :address :work] Map 1: { :name A :address
Input XML: <Data> <BPP> <CP>A</CP> <Name>Joe</Name> </BPP> <BPP> <CP>A</CP> <Name>Show</Name> </BPP> <BPP> <CP>B</CP> <Name>Cunny</Name>
Input: var str = 'text {{value1}} text {{value2}}text{{value1}}'; Regex: var result = str.match(/({{\S+}})+/ig); Output:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.