Welcome to the in5 Answer Exchange! This a place to get answers about in5 (InDesign to HTML5) and make requests.
0 votes
Not sure if this is a how to or a bug.  I have several blank TextFields in InDesign that I'm exporting.  However, when I do so, there's an extra non-breaking space character that's always entered by default.  This forces the textarea to have a space at the beginning when folks start typing.

I don't have any default text or anything in the boxes, but this is how it comes out.

<textarea required="required" data-id="28257" alt="Spare_Time 3" name="Spare_Time 3" id="item28257" class="pageItem ">&nbsp;</textarea>

I'm thinking this might be a bug, and I can probably work around it w/ a script, but want to make sure I'm not doing something wrong first.
in how_to by (180 points)
  

1 Answer

0 votes

I confirmed with Justin that the non-breaking space is intentional. He said that a non-breaking space is added to ensure that the tag is not reduced to remove a closing tag, e.g., <textarea />. He said that can sometimes cause problems (mostly with <div>s).

by (17.3k points)
Thanks @Myra,

Unfortunately, you can't just plop and &nbsp; in between textarea's closing an opening tags.  It's correct that <textarea /> isn't correct, but:
<textarea></textarea> is.  

<textarea>&nbsp;</textarea> puts a default space in every text area, which looks unprofessional especially when the text wraps.  You won't see that on any textarea on the web.

I'm not sure what the magic is behind the scenes and why it can't output as <textarea></textarea> instead of <textarea />, but hopefully they can make this correction.  For now, I'll go ahead and use javascript to clear the &nbsp;, but that's just another indication that this can be done.
You make a good point. This will be resolved in v3.8.8 soon.