Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6207485
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:38:19+00:00 2026-05-24T05:38:19+00:00

In my view I have: <input class=list_item_title name=list_item[title] type=text data-bind=value: title, valueUpdate: ‘afterkeydown’, event:

  • 0

In my view I have:

<input class="list_item_title" 
       name="list_item[title]" 
       type="text" 
       data-bind="value: title, 
                  valueUpdate: 'afterkeydown', 
                  event: { keypress: function(event) { return appListModel.magicMan(event, $data) } }">

Then in JS:

magicMan : function(e, list_item) {
    CL.log(e)

    var code = (e.keyCode ? e.keyCode : e.which);
    if (code == 13) {
        CL.log(list_item.title());
    }

    return true
}

If code == 13, meaning a return/enter, I want to blur out of the input box and highlight it. given the jQuery event being passed, e, how can I do something like $(e.html?).focusOut()?

e looks like this:

jQuery.Event
altKey: false
attrChange: undefined
attrName: undefined
bubbles: true
button: undefined
cancelable: true
charCode: 97
clientX: undefined
clientY: undefined
ctrlKey: false
currentTarget: HTMLInputElement
data: undefined
detail: 0
eventPhase: 2
fromElement: undefined
handleObj: Object
data: undefined
guid: 56
handler: function (event) {
namespace: ""
type: "keypress"
__proto__: Object
handler: function (event) {
isDefaultPrevented: function returnFalse() {
jQuery16108603769612964243: true
keyCode: 97
layerX: 0
layerY: 0
metaKey: false
newValue: undefined
offsetX: undefined
offsetY: undefined
originalEvent: KeyboardEvent
pageX: 0
pageY: 0
prevValue: undefined
relatedNode: undefined
relatedTarget: undefined
screenX: undefined
screenY: undefined
shiftKey: false
srcElement: HTMLInputElement
target: HTMLInputElement
timeStamp: 1312306975744
toElement: undefined
type: "keypress"
view: DOMWindow
wheelDelta: undefined
which: 97
__proto__: Object
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T05:38:19+00:00Added an answer on May 24, 2026 at 5:38 am

    You could do, if you want to simulate a focusOut on the input that triggered the event and add the class ‘highlight’:

     $(e.target).trigger('blur').addClass('higlight');
    

    So your code would look

    magicMan : function(e, list_item) {
    
        CL.log(e)
    
        var code = (e.keyCode ? e.keyCode : e.which);
        if (code == 13) {
            CL.log(list_item.title());
            $(e.target).trigger('blur').addClass('higlight');
        }
    
        return true
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How submit list View in ASP.NET MVC. List View dont have input type=submit value=Save
I have a View where some input text to be added dynamica using jquery,
Lets say I have some view models set up as follows: public class User
I have a partial view: <%@ Control Language=C# Inherits=System.Web.Mvc.ViewUserControl<DomainModel.Entities.Product> %> <div class=item> <h3><%= Model.Name
I have this view: @model MatchGaming.Models.ProfileQuery @{ ViewBag.Title = Index; } <h2>Index</h2> <script src=@Url.Content(~/Scripts/jquery.validate.min.js)
I have a custom class: public class Person { public String Name { get;
I have a view model which is just public class Visits { public List<Visit>
I have a class where I have used data annotations: [Required(ErrorMessage = You must
I'd like to have some hidden inputs on View A.aspx and pass the values
i have view like 'home/details/5', it can be access by anonymous user. but there

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.