how to validate a calendar control in a web page?How to validate an email address in JavaScript?How do JavaScript closures work?How do I check if an element is hidden in jQuery?How do I remove a property from a JavaScript object?How do I redirect to another webpage?How do I include a JavaScript file in another JavaScript file?How to check whether a string contains a substring in JavaScript?How can I refresh a page with jQuery?How do I remove a particular element from an array in JavaScript?How do I return the response from an asynchronous call?

Which was the first story featuring espers?

Why do ¬, ∀ and ∃ have the same precedence?

When were female captains banned from Starfleet?

Why is the Sun approximated as a black body at ~ 5800 K?

awk assign to multiple variables at once

What's the name of the logical fallacy where a debater extends a statement far beyond the original statement to make it true?

The Digit Triangles

US tourist/student visa

Can I say "fingers" when referring to toes?

How much of a Devil Fruit must be consumed to gain the power?

Which Article Helped Get Rid of Technobabble in RPGs?

How to explain what's wrong with this application of the chain rule?

Delete multiple columns using awk or sed

What are some good ways to treat frozen vegetables such that they behave like fresh vegetables when stir frying them?

Shouldn’t conservatives embrace universal basic income?

Can I cause damage to electrical appliances by unplugging them when they are turned on?

How would you translate "more" for use as an interface button?

What does Apple's new App Store requirement mean

Did the UK lift the requirement for registering SIM cards?

What to do when eye contact makes your coworker uncomfortable?

Does the reader need to like the PoV character?

Does an advisor owe his/her student anything? Will an advisor keep a PhD student only out of pity?

Is there a nicer/politer/more positive alternative for "negates"?

15% tax on $7.5k earnings. Is that right?



how to validate a calendar control in a web page?


How to validate an email address in JavaScript?How do JavaScript closures work?How do I check if an element is hidden in jQuery?How do I remove a property from a JavaScript object?How do I redirect to another webpage?How do I include a JavaScript file in another JavaScript file?How to check whether a string contains a substring in JavaScript?How can I refresh a page with jQuery?How do I remove a particular element from an array in JavaScript?How do I return the response from an asynchronous call?













0















I need to validate a calendar and that is the only input in my web page. If I gave a wrong input, it should show a pop-up alert but instead I am getting an exception.



Javascript:



<script type="text/javascript">
function Month_Validation()
var date= txtSearchDate.Text;
var month = date.substring(0, 2);
if (month >12)
alert("Please enter a valid date");


</script>


C#:



string jsMethodName = "Month_Validation()";
ScriptManager.RegisterClientScriptBlock(this, typeof(string), "uniqueKey", jsMethodName, true);


An example of the wrong input is "13/7/2019" (mm/dd/yyy) and the I am getting a System.FormatException exception at the line DataTable dt = myTmsBl.GetRoutes_MyViewRoutes(connstr, Convert.ToDateTime(txtSearchDate.Text), Session["UserId"].ToString());










share|improve this question
























  • What is example o wrong input? What exception you are getting? Which line of code throws the exception?

    – Chetan Ranpariya
    Mar 7 at 5:30











  • the wrong input which I gave is ''13/7/2019"(mm/dd/yyy) and the I am getting 'System.FormatException' exception and I am getting exception at the line "DataTable dt = myTmsBl.GetRoutes_MyViewRoutes(connstr, Convert.ToDateTime(txtSearchDate.Text), Session["UserId"].ToString());"

    – Vinitha Ganesan
    Mar 7 at 5:47












  • codeproject.com/Questions/843083/… Custom validator is the way for you...

    – Chetan Ranpariya
    Mar 7 at 6:08












  • actually I got pop-up alert for month but I am unable to validate date. I used the below lines in aspx.cs page to validate month ' ScriptManager.RegisterStartupScript(this, this.GetType(), "PopUp", "alert('Please enter a valid date');", true); txtSearchDate.Focus();'

    – Vinitha Ganesan
    Mar 7 at 8:13












  • There is no code you have written for date validation. Without code it won't show the error, right?

    – Chetan Ranpariya
    Mar 7 at 8:16















0















I need to validate a calendar and that is the only input in my web page. If I gave a wrong input, it should show a pop-up alert but instead I am getting an exception.



Javascript:



<script type="text/javascript">
function Month_Validation()
var date= txtSearchDate.Text;
var month = date.substring(0, 2);
if (month >12)
alert("Please enter a valid date");


</script>


C#:



string jsMethodName = "Month_Validation()";
ScriptManager.RegisterClientScriptBlock(this, typeof(string), "uniqueKey", jsMethodName, true);


An example of the wrong input is "13/7/2019" (mm/dd/yyy) and the I am getting a System.FormatException exception at the line DataTable dt = myTmsBl.GetRoutes_MyViewRoutes(connstr, Convert.ToDateTime(txtSearchDate.Text), Session["UserId"].ToString());










share|improve this question
























  • What is example o wrong input? What exception you are getting? Which line of code throws the exception?

    – Chetan Ranpariya
    Mar 7 at 5:30











  • the wrong input which I gave is ''13/7/2019"(mm/dd/yyy) and the I am getting 'System.FormatException' exception and I am getting exception at the line "DataTable dt = myTmsBl.GetRoutes_MyViewRoutes(connstr, Convert.ToDateTime(txtSearchDate.Text), Session["UserId"].ToString());"

    – Vinitha Ganesan
    Mar 7 at 5:47












  • codeproject.com/Questions/843083/… Custom validator is the way for you...

    – Chetan Ranpariya
    Mar 7 at 6:08












  • actually I got pop-up alert for month but I am unable to validate date. I used the below lines in aspx.cs page to validate month ' ScriptManager.RegisterStartupScript(this, this.GetType(), "PopUp", "alert('Please enter a valid date');", true); txtSearchDate.Focus();'

    – Vinitha Ganesan
    Mar 7 at 8:13












  • There is no code you have written for date validation. Without code it won't show the error, right?

    – Chetan Ranpariya
    Mar 7 at 8:16













0












0








0








I need to validate a calendar and that is the only input in my web page. If I gave a wrong input, it should show a pop-up alert but instead I am getting an exception.



Javascript:



<script type="text/javascript">
function Month_Validation()
var date= txtSearchDate.Text;
var month = date.substring(0, 2);
if (month >12)
alert("Please enter a valid date");


</script>


C#:



string jsMethodName = "Month_Validation()";
ScriptManager.RegisterClientScriptBlock(this, typeof(string), "uniqueKey", jsMethodName, true);


An example of the wrong input is "13/7/2019" (mm/dd/yyy) and the I am getting a System.FormatException exception at the line DataTable dt = myTmsBl.GetRoutes_MyViewRoutes(connstr, Convert.ToDateTime(txtSearchDate.Text), Session["UserId"].ToString());










share|improve this question
















I need to validate a calendar and that is the only input in my web page. If I gave a wrong input, it should show a pop-up alert but instead I am getting an exception.



Javascript:



<script type="text/javascript">
function Month_Validation()
var date= txtSearchDate.Text;
var month = date.substring(0, 2);
if (month >12)
alert("Please enter a valid date");


</script>


C#:



string jsMethodName = "Month_Validation()";
ScriptManager.RegisterClientScriptBlock(this, typeof(string), "uniqueKey", jsMethodName, true);


An example of the wrong input is "13/7/2019" (mm/dd/yyy) and the I am getting a System.FormatException exception at the line DataTable dt = myTmsBl.GetRoutes_MyViewRoutes(connstr, Convert.ToDateTime(txtSearchDate.Text), Session["UserId"].ToString());







javascript c#






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 7 at 6:01









Dale Burrell

3,39052655




3,39052655










asked Mar 7 at 5:11









Vinitha GanesanVinitha Ganesan

63




63












  • What is example o wrong input? What exception you are getting? Which line of code throws the exception?

    – Chetan Ranpariya
    Mar 7 at 5:30











  • the wrong input which I gave is ''13/7/2019"(mm/dd/yyy) and the I am getting 'System.FormatException' exception and I am getting exception at the line "DataTable dt = myTmsBl.GetRoutes_MyViewRoutes(connstr, Convert.ToDateTime(txtSearchDate.Text), Session["UserId"].ToString());"

    – Vinitha Ganesan
    Mar 7 at 5:47












  • codeproject.com/Questions/843083/… Custom validator is the way for you...

    – Chetan Ranpariya
    Mar 7 at 6:08












  • actually I got pop-up alert for month but I am unable to validate date. I used the below lines in aspx.cs page to validate month ' ScriptManager.RegisterStartupScript(this, this.GetType(), "PopUp", "alert('Please enter a valid date');", true); txtSearchDate.Focus();'

    – Vinitha Ganesan
    Mar 7 at 8:13












  • There is no code you have written for date validation. Without code it won't show the error, right?

    – Chetan Ranpariya
    Mar 7 at 8:16

















  • What is example o wrong input? What exception you are getting? Which line of code throws the exception?

    – Chetan Ranpariya
    Mar 7 at 5:30











  • the wrong input which I gave is ''13/7/2019"(mm/dd/yyy) and the I am getting 'System.FormatException' exception and I am getting exception at the line "DataTable dt = myTmsBl.GetRoutes_MyViewRoutes(connstr, Convert.ToDateTime(txtSearchDate.Text), Session["UserId"].ToString());"

    – Vinitha Ganesan
    Mar 7 at 5:47












  • codeproject.com/Questions/843083/… Custom validator is the way for you...

    – Chetan Ranpariya
    Mar 7 at 6:08












  • actually I got pop-up alert for month but I am unable to validate date. I used the below lines in aspx.cs page to validate month ' ScriptManager.RegisterStartupScript(this, this.GetType(), "PopUp", "alert('Please enter a valid date');", true); txtSearchDate.Focus();'

    – Vinitha Ganesan
    Mar 7 at 8:13












  • There is no code you have written for date validation. Without code it won't show the error, right?

    – Chetan Ranpariya
    Mar 7 at 8:16
















What is example o wrong input? What exception you are getting? Which line of code throws the exception?

– Chetan Ranpariya
Mar 7 at 5:30





What is example o wrong input? What exception you are getting? Which line of code throws the exception?

– Chetan Ranpariya
Mar 7 at 5:30













the wrong input which I gave is ''13/7/2019"(mm/dd/yyy) and the I am getting 'System.FormatException' exception and I am getting exception at the line "DataTable dt = myTmsBl.GetRoutes_MyViewRoutes(connstr, Convert.ToDateTime(txtSearchDate.Text), Session["UserId"].ToString());"

– Vinitha Ganesan
Mar 7 at 5:47






the wrong input which I gave is ''13/7/2019"(mm/dd/yyy) and the I am getting 'System.FormatException' exception and I am getting exception at the line "DataTable dt = myTmsBl.GetRoutes_MyViewRoutes(connstr, Convert.ToDateTime(txtSearchDate.Text), Session["UserId"].ToString());"

– Vinitha Ganesan
Mar 7 at 5:47














codeproject.com/Questions/843083/… Custom validator is the way for you...

– Chetan Ranpariya
Mar 7 at 6:08






codeproject.com/Questions/843083/… Custom validator is the way for you...

– Chetan Ranpariya
Mar 7 at 6:08














actually I got pop-up alert for month but I am unable to validate date. I used the below lines in aspx.cs page to validate month ' ScriptManager.RegisterStartupScript(this, this.GetType(), "PopUp", "alert('Please enter a valid date');", true); txtSearchDate.Focus();'

– Vinitha Ganesan
Mar 7 at 8:13






actually I got pop-up alert for month but I am unable to validate date. I used the below lines in aspx.cs page to validate month ' ScriptManager.RegisterStartupScript(this, this.GetType(), "PopUp", "alert('Please enter a valid date');", true); txtSearchDate.Focus();'

– Vinitha Ganesan
Mar 7 at 8:13














There is no code you have written for date validation. Without code it won't show the error, right?

– Chetan Ranpariya
Mar 7 at 8:16





There is no code you have written for date validation. Without code it won't show the error, right?

– Chetan Ranpariya
Mar 7 at 8:16












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55036485%2fhow-to-validate-a-calendar-control-in-a-web-page%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55036485%2fhow-to-validate-a-calendar-control-in-a-web-page%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

1928 у кіно

Захаров Федір Захарович

Ель Греко