 |
 | Help with Jquery smarika | 17:53 11 Jan '10 |
|
 |
I was trying to mask the inputs phone, email and zipcode using Jquery but it is not working... Can you help me?
<% using (Ajax.BeginForm("SaveContact", null, new AjaxOptions { //OnBegin = "contactEditorDialogPrepare", OnComplete = "contactEditorDialogComplete", Confirm = Model.ConfirmMessage, LoadingElementId = "collateralBusyMessageBox", //UpdateTargetId = "contactData" + item.ID, }, new { @class = "embeddedForm", id = "ContactEditorForm" })) {%>
<%} %>
|
|
|
|
 |
 | A small problem. wer@_op03 | 23:23 24 Sep '08 |
|
 |
Hi, I have a text box with maxlength set as 10. I want the '-' to enter at the 5th position. But in firefox, the positioning of cursor differs. I'm not supposed to increase the width of the textbox. how to go about with it??
P.S: The logic works fine. Just the look and feel
|
|
|
|
 |
|
 |
I mean to say if you reduce the textbox width given in the code to 70px and try in firefox, you will understand my problem.
|
|
|
|
 |
 | required field validator rsgrady | 21:54 12 Oct '07 |
|
 |
When I use a RequiredFieldValidator on this custom control, the client side validation fails. Any ideas?
|
|
|
|
 |
|
 |
please provide some sample code so I can better understand what you're doing and what you're trying to do.
|
|
|
|
 |
|
 |
When an ASP.NET RequiredFieldValidator is set to validate a regular textbox, the Text of the validator is hidden when data is entered into the textbox. This does not happen in the custom control when it is validated by the validator. It does operate as expected on postback.
|
|
|
|
 |
|
 |
Again, please provide some sample code so that I can actually see what you're trying to do.
|
|
|
|
 |
 | Editing? Umer Khan | 1:32 19 Jul '07 |
|
 |
hey here is a big bug ? when you start to edit text box, it doesn't change it rather it move cursor to the end of text
|
|
|
|
 |
|
 |
This version of the method fixes the editing problems for this otherwise great script. It allows you to backspace and also left arrow, right arrow and press the delete key through the text so you can edit any mistakes you have made cleanly without loosing the functionality of inserting the specified characther that you want.
This link shows all the keyCodes of javascript (each represents a keyboard value - a, b, backspace etc) http://www.cambiaresearch.com/c4/702b8cd1-e5b0-42e6-83ac-25f0306e3e25/Javascript-Char-Codes-Key-Codes.aspx[^]
The reason it goes to the end of the page is due to setting the value of textbox to anything. If you post any value like this it will automatically go to the end. Hence if you surround it with the catching if statement like I have you can still edit the text quite happily without it going to the end of the line.
There was no bug in this program, it was just designed without the editing functionality in mind, as you can see it's easy enough to add. Hope this helps.
function mask(str,textbox,loc,delim){ var locs = loc.split(','); for (var i = 0; i <= locs.length; i++){ for (var k = 0; k <= str.length; k++){ if (k == locs[i]){ if (str.substring(k, k+1) != delim){ if (event.keyCode != 8){ //backspace str = str.substring(0,k) + delim + str.substring(k,str.length) } } } } } if (event.keyCode != 37 && event.keyCode != 39 && event.keyCode != 46) { textbox.value = str; } }
|
|
|
|
 |
 | More Than one Delimare yaseencarter | 3:32 18 Jul '07 |
|
 |
Example;(222) 222-2222 what changes are required for above example
muhammad yasin
|
|
|
|
 |
 | (232) 232-2323 how to do thta Umer Khan | 0:54 18 Jul '07 |
|
 |
its really really nice thing great work can you provide me help regarding this format (232) 232-2323
??
|
|
|
|
 |
 | Thanks! sweettomandjerry | 16:45 4 Apr '07 |
|
|
 |
 | Great tool! gogetsome | 5:49 28 Jul '06 |
|
 |
Hello, I've look far and wide for a simple solution for an input mask. Your's works great for masking 111-111-1111. I have a slight variation that I'm trying to do like: (111) 111-1111
Is it possible for your code to be changed to do it that way?
|
|
|
|
 |
 | Jumps to beginning of field daddion | 7:46 19 Sep '05 |
|
 |
I am using IE6. When I tab into some of the fields with the input mask it moves to the front of the textbox instead of highlighting the textbox as normal. Not on every textbox assigned the input mask, but always on the same ones.
|
|
|
|
 |
|
 |
The problem only occurs when coming from other textboxes. If I enter from a dropdownlist, for example, it works - the textbox is highlighted and the user can start typing. I think it is capturing the tab up keyup event.
|
|
|
|
 |
|
 |
Sorry to keep replying to myself, but the modify message is broken at the moment. I solved it by adding this to the beginning of the script:
if (event.keyCode == 9) return false;
|
|
|
|
 |
 | firefox Anonymous | 18:52 12 Nov '04 |
|
 |
It doesn't work with firefox 1.0...
|
|
|
|
 |
 | Netscape Anonymous | 11:49 20 Jan '04 |
|
 |
There's some weird stuff occurring when you try to run this script in Netscape. The events are not being handled properly. Any thoughts?
|
|
|
|
 |
|
 |
what version of netscape?
|
|
|
|
 |
|
 |
I'm using version 7.1. Works like a charm in I.E. but I believe that Netscape's event handling is not up to snuff. I.E. handles the onKeyUp events while Netscape just lets them go by. If you get a chance to try it with 7.1 please do so. We may need to do so before we blame Netscape for its inadequacies . Also, the fix that you used to capture the backspace event may not work with Netscape. (e.which) may need to be used in this case. I'll have to sniff the browser then incorporate this event handler. Please let me know if you encounter the same problem as it may be native to my machine. Thanks.
|
|
|
|
 |
|
 |
if I understand things correctly, the reason it's not working at all in netscape is because netscape is returning a javascript error when it get's to the "event.keyCode" - since netscape does not recognize this command it will not go further. in netscape what you would have to do is first capture the event and then check what occured. - for example
<script>
window.onKeyPress = captureKey();
function captureKey(e) { if (document.all) { nKeyCode = event.keyCode; } else{ nKeyCode = e.keyCode } } </script>
- I did not test this code, however this should work.
|
|
|
|
 |
 | Another bug bm_ross | 18:30 15 Sep '03 |
|
 |
This code is great except there is one other issue also.
If you highlight the hyphen and type another number then it adds extra characters.
|
|
|
|
 |
|
 |
did u find the solutiohn of this bug?
|
|
|
|
 |
 | Deleting Field information Eric Bennion | 4:52 19 Aug '03 |
|
 |
After I entered my data, I realized it was wrong, so i tried to go back and change it, but the script wants to re-insert the delimiter each time I delete it. I tried to tab from field to field, which normally selects the data in the field, but for some reason the data briefly is selected and then the block dissapears. I finally was able to delete the fields by tabbing and immediately hitting my delete key. It took a few tries, but I was finally able to do it. Is there an easier way to change the data in a field?
|
|
|
|
 |
|
 |
It's me again...I realized that a reset button would take care of the problem.
<input type = "reset" value="Reset">
|
|
|
|
 |