473,320 Members | 2,193 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Insert image from prompt

23
Hi, have a problem and do not know hot to solve it.

Image needs to insert where the cursor is.

I have to hit the space bar, select the space, then insert the image (works).

How do I insert the image exactly the where cursor is?

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <title>image problem</title>
  4. <script type="text/javascript">
  5. <!-- 
  6. function IFO() {RT.document.designMode = 'On';}
  7.  
  8. // -- problem area
  9. // -- Needs to insert at cursor position 
  10.  
  11. function IMG() {var imgSrc = prompt('Enter image location', ''); if(imgSrc != null) { RT.document.execCommand('insertimage', false, imgSrc);}}
  12.  
  13. // -- end problem area
  14.  
  15. function submit_form() {var theForm = document.getElementById("wyfm"); theForm.elements["Entry"].value = window.frames['RT'].document.body.innerHTML; theForm.submit();}
  16. //  End -->
  17. </script>
  18.  
  19. </head>
  20. <body onLoad="IFO();" style="font-family:vardana, arial,sans serif; font-size:105%;">
  21. <br><div style="text-align:center;">
  22. <br>
  23. <form action="#" name="wyfm" id="wyfm" method="post">
  24. <input type="button" onClick="IMG()" value="Img" title="Insert image">
  25. <br><br>
  26. <textarea style="display:none;" name="Entry" id="Entry" cols="100" rows="14"></textarea>
  27. <iframe name="RT" id="RT" style="width:400px; height:200px;"></iframe>
  28. <br><br><input name="myBtn" type="button" value="Save" onClick="javascript:submit_form();">
  29. </form>
  30. </div>
  31. </body>
  32. </html>
  33.  
Hope somebody can help - thanks
Jan 15 '17 #1
2 2324
Roamer
23
No response yet.

Have been unwell and just been able to get back here.

This works in chrome okay but not in Internet Explorer. IE is the one I have to have a space and select it.

So what do I do to make it work with IE?

Thanks
Mar 12 '17 #2
gits
5,390 Expert Mod 4TB
may be you can check here: https://social.msdn.microsoft.com/Fo...webdevelopment
Mar 15 '17 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Abhishek Bagga | last post by:
I want to insert Image in the column headers of the Listview control I have been trying this but was unable to achieve it. Is it possible? if yes kindly guide me how to achieve this. -- -...
0
by: linus | last post by:
Anyone try insert image or binary files to MySQL using ASP.NET? Thanks a lot
2
by: guoqi zheng | last post by:
dear sir, I am using itextShap for pdf generation. I know I can insert image into it, I can add header to it as well. However, I can not add an image as a header. Does any one has experience...
1
by: anuragpj | last post by:
how to insert image in a table in pgsql database.
0
by: gazanfar | last post by:
Yes thanks Question is that ---I want to insert image/or image path in my SQlServer 2000 through Visual basic application.like after scan of any photo i want insert in database on whoever's no...
2
by: shekhar051 | last post by:
how to insert image as a back ground in header row in C#
2
by: yusufjammy | last post by:
How to insert image in mysql database via php and how to retrieve in php ?
2
by: lwannwayoo | last post by:
Hi Everybody! I have a database in Microsoft Access 2003 and I want to insert image in my Table Field. How can I don it??. I use OLE type but when i insert image to that field only the word...
2
by: mohanty2050 | last post by:
How can I split a cell and insert image in a particular cell of a cross tab report?
3
by: Napsterr | last post by:
I have a RichTextEditor control. I want to insert image whereever the cursor is. Onclicking Insert link i want to insert Image. Is it possible? I have this design in .aspx page. After...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.