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

Check out Best Alternative to InfoPath


In this article we will learn what about the 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 SharePoint list using JSOM from a HTML form.


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

a text field contains invalid data. please check the value and try again
request failed invalid text value SharePoint



Solution:

While creating a SharePoint list we need to be careful while taking list type, and should take same type while creating a HTML form. For an example if in the SharePoint list I have taken 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”.


Hope the above solution will be helpful.


You May Also like the Following SharePoint Online Tutorials: