2

How can JSON input into a form textarea field be validated using jQuery?

1 Answer 1

4

You can use jQuery.parseJSON

var theJson = jQuery.parseJSON($(this).val())

quick example on jsfiddle.

Sign up to request clarification or add additional context in comments.

1 Comment

Update many years later: jQuery.parseJSON() is deprecated. You should use JSON.parse() instead.

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.