Solved

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

Posted on 2013-11-07
8
918 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
Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

 
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
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…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

617 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