1

Want to know how to use a jQuery blur function for my SPNumberField, single line of text etc fields.I do not have the ID of the field, also how to get the ID for using the same in jQuery function?

Copying from the viewsource or F12 Developer Tools is not a good practice and I can't insert any span tag or div id for those fields as its a pure SP 2010 ListForm

1
  • You will probably get more answers from advanced users on your questions when you mark questions as answered, thats how StackOverflow works.. you give credits, you earn credits. Commented Oct 17, 2015 at 15:04

1 Answer 1

2

You do not need id, any selector to get a DOM element will do.

I recall from my 2007 days you can get elements by searching for the last part of the name

$(input[name$='NumberField'])

or something like that

BTW you do not need jQuery either

http://callmenick.com/post/jquery-functions-javascript-equivalents

this site will also educate you on how to attach events

1
  • I tried inside a Content Editor webpart by putting the blur function within the document. ready() but it didn't work. That's why I posted your answer as useful.
    – samolpp2
    Commented Oct 17, 2015 at 15:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.