Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2013-11-07
8
Medium Priority
?
922 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
[X]
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
  • 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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 2000 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

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

704 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