Solved

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

Posted on 2013-11-07
8
862 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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 Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

762 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now