Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2013-11-07
8
896 Views
Last Modified: 2013-11-08
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
0
Comment
Question by:thenelson
  • 3
  • 2
  • 2
8 Comments
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 39632099
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&
0
 
LVL 39

Author Comment

by:thenelson
ID: 39634721
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?
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 39634993
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&
0
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 
LVL 58

Expert Comment

by:Gary
ID: 39635019
Try CTRL + Enter
0
 
LVL 39

Author Comment

by:thenelson
ID: 39635153
>Try CTRL + Enter
I have: doesn't work. Neither does Sft + Enter, Alt + Enter or any combination of those.
0
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 39635164
That was a completely random guess at a solution.

If the WB control can execute js (don't remember) you could attach onkeypress event to it and if the Enter key is pressed then manually add a CR in a js function

In searching I also found these which may work for you
http://tech.dir.groups.yahoo.com/neo/groups/MS_Access_Professionals/conversations/topics/77218
http://www.developerfusion.com/thread/30753/carriage-return-in-a-webbrowser-control/
0
 
LVL 39

Author Closing Comment

by:thenelson
ID: 39635198
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
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question