Error: "The entity "nbsp" was referenced, but not declared."
Error: "The entity "nbsp" was referenced, but not declared."
We used to get this occasionally from users when they copy text from another system (email client) and go to paste it in our Aware built app. Now seems to be an increasing occurrence, does anyone get this complaint from users a lot?have any tips about how to avoid it?
Rod. Aware 8.6 (latest build), Developer Edition, on OS Linux (Ubuntu) using GUI hosted on AWS EC2, MYSQL on AWS RDS
Re: Error: "The entity "nbsp" was referenced, but not declar
I do see it regularly but do not have a resolution. Possibly a text encoding thing. I use MySQL 5.6. Note that in my case, the error is caused by pasting text from either MS Word or PDF documents. I'm sure you recognize nbsp as an HTML tag.
V8.8
MySQL, AWS EC2, S3
PDFtk Toolkit
MySQL, AWS EC2, S3
PDFtk Toolkit
Re: Error: "The entity "nbsp" was referenced, but not declar
We also face this issue many times and have followed a poka-yoke approach. One quick solution is to remove "NBSP" in the component (AIM Attribute) before creating the BO. We can implement below shown code snippet at On-Change event of txtArea. This will remove any NBSPs after typing or copy-pasting.
------------------------------------------------------------------
$('#'+txtAreaId).change(function(){
$('#'+txtAreaId).val($('#'+txtAreaId).val().replace(/ /g, ''));
});
------------------------------------------------------------------
In AIM, this can be written under Render Script section of Main Form >> Advanced >> Scripts.
------------------------------------------------------------------
$('#'+txtAreaId).change(function(){
$('#'+txtAreaId).val($('#'+txtAreaId).val().replace(/ /g, ''));
});
------------------------------------------------------------------
In AIM, this can be written under Render Script section of Main Form >> Advanced >> Scripts.
Re: Error: "The entity "nbsp" was referenced, but not declar
Thanks! Your code worked nicely for us with a few modifications:softserv wrote:We also face this issue many times and have followed a poka-yoke approach. One quick solution is to remove "NBSP" in the component (AIM Attribute) before creating the BO. We can implement below shown code snippet at On-Change event of txtArea. This will remove any NBSPs after typing or copy-pasting.
------------------------------------------------------------------
$('#'+txtAreaId).change(function(){
$('#'+txtAreaId).val($('#'+txtAreaId).val().replace(/ /g, ''));
});
------------------------------------------------------------------
In AIM, this can be written under Render Script section of Main Form >> Advanced >> Scripts.
Code: Select all
$('#Gatuadress').change(function(){
$('#Gatuadress').val($('#Gatuadress').val().replace(' ', ''));
});