A text field contains invalid data. Please check the value and try again. Undefined

We will discuss how to fix error “A text field contains invalid data. Please check the value and try again. Undefined” which incurred and its solutions when I was trying to insert values to the SharePoint list using JSOM from an HTML form.

Here while working on a SharePoint list to reflect data inserted from an HTML form I encountered this pop-up error displayed as below

A text field contains invalid data.Please check the value and try again

A text field contains invalid data.Please check the value and try again

While creating a SharePoint list we need to be careful while taking list type and should take the same type while creating an HTML form.

For example if in the SharePoint list I have taken a single line of text in HTML I should also take text box, and if numbers then in HTML type should be numbers.

Here this error occurs as in HTML form I had taken type s number and was trying to bind the values to SharePoint list with a column type of single line of text using JSOM, We also need to be careful while passing the HTML element’s ID in var statement in the JSOM script.

Error due to input type “number”:

<tr>
<td colspan="3"></td>
<td>LaptopId </td>
<td><input type="number" id="LaptpID"
</tr>

input type should be “text” :

<tr>
<td colspan="3"></td>
<td>LaptopId </td>
<td><input type="text" id="LaptpID"
</tr>

As in SharePoint we have taken column type as “single line of text” in HTML element type should be “text”.

You may like following javascript tutorials:

This tutorial, we learned how to fix error A text field contains invalid data. Please check the value and try again. Undefined.

Donwload Hub site pdf

Download SharePoint Online Tutorial PDF FREE!

Get update on Webinars, video tutorials, training courses etc.

Bijay Kumar

I am Bijay from Odisha, India. Currently working in my own venture TSInfo Technologies in Bangalore, India. I am Microsoft Office Servers and Services (SharePoint) MVP (5 times). I works in SharePoint 2016/2013/2010, SharePoint Online Office 365 etc. Check out My MVP Profile.. I also run popular SharePoint web site SharePointSky.com

>