Hi friends, today i am going show you how to Restrict Special Characters in TextBox or in Textarea using JavaScript in asp.net.
Screen 1
I have two method to do it in javascript.
First Method:
In this method you only want to add "RestrictHtmlCharacter-Tags.js" file in order to restrict special character in textbox.
Using this method you don't need to add anything to textbox. Only you have to do one thing only call that "RestrictHtmlCharacter-Tags.js" js file in your page and it will restrict all the textbox entering special character. For this you have to add jquery 1.7.2.min.js
Using this way you don't need too add anything in textbox only add this javascript file.
Second Method:
The second method to do the same is following: The script works in such a way that the TextBox will accept only alphabets, numbers i.e. alphanumeric values with some allowed special keys, thus unless a special character key has been specified to be excluded it won’t be accepted.
We've got a sweet solution that uploads an image with AJAX and then immediately displays.
Ajax ,an acronym for Asynchronous Javascript and Xml is a group of interrelated web development techniques used on the client side to create asynchronous web applications.With Ajax, web applications can send data to, and retrieve data from, a server asynchronously (in the background) without interfering with the display and behavior of the existing page.
Here we are usingajaxupload.js to upload an image and show upload button on mouse hover and mouse out same like facebook.
Screen 1
On Mouse hover show upload button
Screen 2
Choose image file
Screen 3
Finally Preview of image without postback (without refreshing page)
Screen 4
JS :
You need this following javascript file to perform AJAX Image Upload they are following:
Styled Checkboxes with pure CSS that work upto IE5 and cross browser
Styled checkboxes with pure CSS
The
idea is that using the ':before' pseudo-class allows us to define the
checkbox style in pure CSS, using the 'content' attribute to define the
check symbol used and the ':checked' pseudo-selector to switch it.
':before' has to be on the subsequent element so that we can select it
properly (you can't define ':before' for <input> elements).
IE
8 doesn't support ':checked' so we switch a class on it using jQuery
and IE 6 & 7 don't support ':before' so we add a <span> to do
its job.
IE fallbacks currently don't work! Feel free to suggest fixes :-)