Jquery - .net With RegularExpression Is Not Working?
May 12, 2010
I'm try to do validation on a textbox input to validate a phone number.I have an asp.net textbox and checkbox. The default is to validate a US phone number and when I check the checkbox I should change the RegularExpression and error message to validate an international phone using my own RegularExpression.
I am trying to use the ASP.NET regularexpressionvalidator to apply a password policy that enforces the following policy:
Password should include at least 6 characters, at least one small letter, at least one Capital letter, at least one number, and at least one special character. Here is the expression:
The strange thing I found is that it works fine except with the following scenario, If I use all the required combination without special character such as Hello123" it finds it as valid password. below is the controls used for testing.
I am using urlrewriter.net and I am trying to make a redirection. So here is the condition,If the requested url doesn't end with a / (slash) and then add / at the end of the url an redirect to added urlSo if the url is "http://www.something.com/cases" then add / and redirect it to "http://www.something.com/cases/"
Here i have one String like ...string str=" ramesh empcode 001 adress #124, bangalore rajesh empcode 002 suresh empcode 003 phonenumber 9019057563";this is my string and i dont want to add anything to string i mean to split.But here i can take string to separate with names like string[] separators=new string[] {ramesh,rajesh,suresh};i need to done with RegularExpression then only code will be Accurate for any type of string.here i suppose to get output like this ramesh empcode 001 adress #124, bangalore rajesh empcode 002 suresh empcode 003 phonenumber 9019057563
I wanted to write a regular expression using the ASP.Net RegExp validator that would ensure a field contains only numeric and decimal values, and at least one character.
^[0-9]{1,40}(.[0-9]{1,2})?$
Essentially: [0-9]{1,40} - meaning at least one to 40 numeric characters.The ASP.Net regexp validator does not fire for an empty field - where there is not at least one character.
iam using regular expression in javascript function to validate email. iam calling javascriptfunction using asp.net custom validator. email validation is working. when i click the textbox the cursor is in the middle of the textbox. it's not moving to endof the text or beginning of the textbox, if the textbox is empty. do you have any idea about this error.
I have a regular expression validation control initialized to validate a textbox control. I want users to be able to enter U.S. Currency values ($12,115.85 or 1500.22 etc.). I found a regular expression off of regexlib website that does the trick. The validation control seems to be working except for one crucial thing. If invalid data is entered, the validation text dispalys (a red "*" next to the textbox), but the page will still submit and the error message won't pop up... I thought that the error message is supposed to display and the page won't submit if the validation control detects invalid data. Isn't this automatic with ASP .NET? I have searched extensively on how to create validation controls, but haven't found anything different than what I am already doing. Can anyone tell me what I am doing wrong here?
I am new to jQuery, i am tring that In my pages contain four checkboxes then if any checkbox is checked then one div is dispaly , in that div some controls is placed. My intension is if checkbox is checked then validation for that particular div contained controls,
I have implemented a lot fo JQuery features into my ASP.Net web application. I am using JQuery, JQueryUI, JQuery Validation and a couple of other plugins. They are all coexisting and working fine. This one page in my app has the JQueryUI tabs, Modal progress pop-up working just fine. This page also has a couple of JQuery AJAX calls to my server side events. That all works fine!
I just added a Jquery date picker to one of the text boxes on the first tab on my data entry form and nothing happens or is displayed when you click on the date textbox. I am going to post the HTML markup for the page and my JQuery code. Please let me know if you see anything glaring? HTML
I have the following jQuery that does find the ASP.NET server control (tested by placing an alert() inside block), but it does not set the height on the next DIV in the DOM using .next(). However if I use straight JS to do the same thing, calling the DIV by ID directly it works fine. What I am trying to do is not use the hardcoded ID of the DIV in case it changes, and rather walk the DOM to dynamically get to the element and set the height. So 1st: the HTML source of what I am trying to manipulate:
Next the non-working jQuery that I think should work:
//Using the 'DIV' that is created by the viewer (at runtime), resize it dynamically to fit the window var myHeight = $(window).height(); if ($('#<%=WebViewer.ClientID %>') != null) { $('#<%=WebViewer.ClientID %>').next('div').height(myHeight - 10); }
And lastly the JS that does work, but I would prefer not to access that DIV by a hardcoded ID and use jQuery instead:
var myHeight = $(window).height(); //Using the 'DIV' that is created by the viewer (at runtime), resize it dynamically to fit the window if (document.getElementById('WebViewer_controlDiv') != null) { document.getElementById('WebViewer_controlDiv').style.height = myHeight - 10; }
why walking the DOM in jQuery to get the 'next' div and set its height is not working?
Im using MVC 2 and .NET 4 on my local machine. I can debug my project using the Visual Studio Development Server locally. Everything works great, including the validation using
i am trying to include some tooltips in my MVC project. but i cant get any jquery effect from it, what i see is just default tooltip. I had follows several examples but still cant get it. currently i am doing like this:
I'm developing a website using asp.net mvc and I have this image that fire an Ajax event when clicked. It works just fine on FF and IE 7 & 8, but on IE 6 it doesn't even call the method on the controller (I did put a breakpoint there and ran it on debug mode to check). I'm on it for a few days now and can't find a solution. Here's my code:
I am using jquery to expand/collpase a div that contains a menu but i get the following error only in IE 8 and maybe on all IE but have no way to test with older versions as I dont have one installed. I even upgraded to lates jquery library but problem persists. Other browsers work perfect.Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; InfoPath.2; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729) Timestamp: Wed, 16 Mar 2011 20:25:37 UTC Message: Object doesn't support this property or method Line: 16 Char: 39490 Code: 0
$('#' + textboxID).autocomplete({ delay: delay, source: ["cats", "dogs"] }); which works fine. I want to use a webservice: $('#' + textboxID).autocomplete({ delay: delay, source: webserviceURL}); This doesn't work. My webservice URL is /blah/blah.asmx/myMethod The webservice definition is: [WebMethod] [ScriptMethod(ResponseFormat = ResponseFormat.Json)] public List<string> myMethod(string term) { // Logic here, return list of strings }
The method never gets called. Can anyone point me in the right direction? I have other webservices in the same .asmx which work fine with other controls (other controls are using $.ajax to call them).
Edit: Getting closer, I now get a 500 error saying Request format is unrecognized for URL unexpectedly ending in '/myMethod'. I think it's not treating my url quite right..