Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

javascript - Change Enter from submission to Tab? -


users don't fact enter key submits page. tasked preventing submission , changing enter key tab next field.

i have tried many javascript snippets found on net none have worked far. 1 has come close having effect e.preventdefault() of jquery api, stops submit, nothing have tried emulates tab behavior.

e.returnvalue = false; e.cancel = true; 

page still submits above in keydown event handler. same effect return false in keydown event handler. handler firing, tested putting breakpoint in firebug.

this needs work both ie , firefox.

don't "don't this".
1) i'm convinced shouldn't it, it's not choice mine, discussion mute.
2) answer question "should this?", not question asking.

this feels icky, use event.preventdefault mentioned , call focus() on next closest input:

here's simple example:

$("input").bind("keydown", function(event) {     if (event.which === 13) {         event.stoppropagation();         event.preventdefault();         $(this).next("input").focus();     } }); 

example: http://jsfiddle.net/andrewwhitaker/txg65/

update: if have elements in between inputs, using plain next() not work. instead, use nextall():

$("input").bind("keydown", function(event) {     if (event.which === 13) {         event.stoppropagation();         event.preventdefault();         $(this).nextall("input").eq(0).focus();     } }); 

http://jsfiddle.net/andrewwhitaker/grtqy/


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -