Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Form passing validation but failing on save with short answer #270

Closed
BazzaPreece opened this issue Jan 27, 2020 · 4 comments
Closed

Form passing validation but failing on save with short answer #270

BazzaPreece opened this issue Jan 27, 2020 · 4 comments

Comments

@BazzaPreece
Copy link

BazzaPreece commented Jan 27, 2020

When using a short answer on a form, the database restriction for saving is 255 characters but the max length of the input is set as 500. This allows users to enter more than the 255 characters which is seen as a valid entry so form submission isn't stopped. However, when the data is saved to the database, the database triggers a “String or binary data would be truncated” error. The user believes everything is ok, but no data is stored in the database.

Reproduction

Create a form that writes to the database
Add a short answer field
Fire up the form
Enter more than 255 characters into the short answer field
Submit the form

Expected result

If the form is unable to save the data, would expect form validation or data input restrictions to ensure that the form isn't submitted


This item has been added to our backlog AB#5507

@nul800sebastiaan nul800sebastiaan added the state/sprint-candidate We're trying to get this in a sprint at HQ in the next few weeks label Jan 27, 2020
@TQ-Benji
Copy link

Seeing this in Forms version 8.6.0.

dbo.UFRecordDataString 'Value' column definition is (nvarchar(255), not null) yet the FieldType.Textfield.cshtml has maxlength="500"

@AndyButland
Copy link

This duplicates #563 and was resolved in 8.7.3,

@umbrabot umbrabot removed the state/sprint-candidate We're trying to get this in a sprint at HQ in the next few weeks label Oct 5, 2021
@andyfelton-equatedigital

@AndyButland was this modification back ported to Forms 7?

Thanks

@AndyButland
Copy link

No, I'm afraid not. This update was made in Forms 8.7.3 by the looks of it, so only versions beyond that will have the fix in. I think here though you could apply it yourself, by updating the maxlength setting for the text box field in your theme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants