asp.net mvc - jquery selection problem -
On some watch pages I have two partial views (their html is similar). The first one works with this script but the other does not work
The problem comes when try to get article_number because I have two input boxes with some ID (id = marticlanknumber). If I change the second id for id = MArticleNumber1 So he has two article numbers but I have to do the action DevAccEditTemp only enable an article number. First, you can use more short-hand calls to get the value from an element with the ID (* details below).
var article_number = $ ("#MArticleNumber") val () .; Second, it is not valid for elements with the same ID ID must be unique according to HTML specifications: www.w3.org Your ID is unique By creating, you will have a problem.
(*) Explain why you should use the # selector instead of selector in [id = ...] in JQuery.
$ ("# myElementId")
Using the #id will result in a simple getElementById call, which is fast and simple. Therefore, the type of element is not relevant.
$ ("Input [id = myElementId]")
To display this lookup, you first get all input elements, then specify Loop around to find a match based on attribute search.
Comments
Post a Comment