I have a web app deployed in which a handful of users out of a couple of hundred cannot enter anything as the text changes to the word “undefined” when the code copies the contents to a dictionary which I subsequently post to the database. I am unable to duplicate the problem so cannot run it in the debugger to actually see happen.
The users are limited to 250 words, about 1800 characters. Here is a code snippet from the save button on the page which includes a couple of tests I put in to help me figure what is causing the problem…
[code] abstractTest =txtAr_Abstract.Text
session.Project.Value(“projectSummaryWasUndefined”) = “false”
session.Project.Value(“projectSummary”) = ReplaceLineEndings(txtAr_Abstract.Text,EndOfLine)
if session.Project.Value(“projectSummary”) = “undefined” then
session.Project.Value(“projectSummary”) = abstractTest
session.Project.Value(“projectSummaryWasUndefined”) = “true”
end if[/code]
This code is wrapped in a couple of if statements…
If txtAr_Abstract.text <> “” then
If txtAr_Abstract.text <> session.Project.Value(“projectSummary”) then
I put the if statement in the above snippet to see if the text was changed before the post to the database, which as you can see it is. I also wanted to remove the possibility that the ReplaceLineEndings function was causing the problem. I will be revising this slightly tonight to save txtAr_Abstract.Text directly to the dictionary instead of the abstractTest variable.
The dictionary is sent to the database which returns the dictionary received and xojo diplays it on a different page. I can read the dictionary in the database and so doing have confirmed that the “defined” is being saved to the dictionary instead of the entered text in xojo before posting to the database.
Anyone see what might be causing the problem. There are a couple of possibilities that might be causing the problem. One might be the length of the text? Is there a limit to what can be enteed in a text area or stored in a dictionary. It’s got to be far greater thatn 1800 characters. Another issue might be how the user is entering the text. We have directed them to type it in, but we have no control of how they do it. Some may be copying the text from GoogleDocs or a word processor. This has caused us problems in the past with unrecognized characters being injected in the text. This is the first time I have seen this problem with “undefined”.
Thanks for any help.
John