Link to home
Start Free TrialLog in
Avatar of thenelson
thenelson

asked on

Html form accepts carriage returns in browsers but not using the Microsoft Web Browser ocx

I have an html form with the following textarea:
<td colspan="2">
   <textarea rows="20" class="mywidth" name="body" required>
   </textarea>
</td>

It works fine with all web browsers (IE, FF, Chrome, Safari). The Enter key gives me a new line in the textarea. But when I open the html form in the Microsoft Web Browser ActiveX control in Microsoft Access, pressing the Enter key does nothing. If I paste text from say Notepad with carriage returns into the textarea in the form in the Microsoft Web Browser Control, it copies fine but I cannot enter carriage returns into the textarea using the Enter key.  Any idea what I need to do to allow that?

TIA
Avatar of COBOLdinosaur
COBOLdinosaur
Flag of Canada image

MS desktop apps do not follow W3C standards and there is never any guarantee how well any document will migrate between standards compliant browsers and those apps.  

Anything produced n Office will have issues in a standards compliant browser due to the lack of standards support.  If activeX id involved it is even more of a problem.  Only IE support activeX and even IE 10 has reduced support for active X use as MS tries to a higher level of standards compliance. See: http://msdn.microsoft.com/en-us/library/ie/hh920753%28v=vs.85%29.aspx

Cd&
Avatar of thenelson
thenelson

ASKER

The link you provided addresses Windows 8. I am using Windows 7. It is strange since I do not have this problem with other sites I open in the browser control.

I have control of the website also. Is there something I can do there (with Java perhaps) to get the enter function?
I am an HTML Expert, and I work with open source environment.  this is some kind of a problem with Access or Office and I don't have any additional ideas.  Perhaps we will ge an Access Expert coming in who can solve it.

Cd&
Try CTRL + Enter
>Try CTRL + Enter
I have: doesn't work. Neither does Sft + Enter, Alt + Enter or any combination of those.
ASKER CERTIFIED SOLUTION
Avatar of Gary
Gary
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Gary,
Your second link had the answer:
Any webpage with a texteara field will not put a carriage return with ctrl-enter or enter.  Fortunately for me I finally did find a key that would put an enter in this html form field, ctl-m.
I was working with MS access and here is what I did to make "carriage return" work like it should on a textarea field.


You set the keypreview to "on" on the main form.
On the main form put this code on the keyup event


if keycode = 13 then
 sendkeys "^m"
end if

Thanks!!
Nelson