473,320 Members | 2,088 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.

onkeyup event for iframe

134 100+
hi

i downloaded an text editor from

http://www.hscripts.com/scripts/JavaScript/richtexteditor.php

it works well for me..

when the user types the text and modify it using the editor i need to display it in an preview section automatically..

the scripts uses iframe to work in the editor.,

i ve shown the preview by using an preview button and using the code below

Expand|Select|Wrap|Line Numbers
  1. function showpreview()
  2. {
  3.   var myIFrame = document.getElementById("content");
  4.   var content = myIFrame.contentWindow.document.body.innerHTML;
  5.   document.getElementById("previewsection").innerHTML=content;
  6. }
  7.  
it works well.,

but i need to display it automatically without using any preview button like

using an KEYUP event..

is there a way...

regards
vijay.
Apr 26 '10 #1
1 3204
RamananKalirajan
608 512MB
You can do that buddy... But the logic you have chosen is a wrong one. if you are using keyup function whenever you type a character this print preview window will open. The best way to do is. You can use a timeStamp variable and you can set a min interval. once the user starts to type you should add this listener. When the user stops typing check for the time interval which has been left ideal and then trigger the print preview window.

Thanks and Regards
Ramanan Kalirajan
Apr 27 '10 #2

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

Similar topics

4
by: Thomas | last post by:
Hi there, I have an iframe which is editable (designMode = "on") and want to resize it dynamically as the content grows (e.g. more lines of text is in there) and there the struggle starts. I...
5
by: Matthew | last post by:
Is there anyway to tweak this to ignore the function() only if the Tab key is pressed? onkeydown="javascript:function();"
3
by: Trent | last post by:
Hi. I know the basic way to assign event handlers: <input onKeyUp="processEvent(event)" /> But how do I assign a function to the onKeyUp event in *javascript* that can access the event...
2
by: Evan Wong | last post by:
I have problem to get onkeyup event. If we put the event in HTML statement like - "<input name=field1 size=16 onkeyup="javascript:function1();>" it works. If we put in JavaScript code like...
1
by: tedqn | last post by:
I use the js onKeyup event to trigger server side db searches in a hidden iframe page and generate a list of selectable items in the parent page. The minimum characters to initiate a search is 3....
2
by: john.lum | last post by:
My overall objective is to create something akin to Google Suggest, where a query is done in response to changes in a text field presented to the user. I've got things working using the onkeyup...
3
by: Brad | last post by:
The first text on my form is a numeric field. I have a javascript that runs on this field for onkeyup (validate the key strokes and modifies fields on the screen) but when I do this and have the...
2
by: mc | last post by:
Can someone suggest how I would add a new trigger such that when the JS event onkeyup in a textbox the updatePanel refreshes? If not could someone sugest how I could onkepup in a Textbox, refresh...
3
by: Brent | last post by:
The code below correctly sets an iframe to be editable, and then tries to attach an "onkeyup" event to the iframe. Instead of doing that, however, it generates a cryptic "Object required" error in...
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
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...
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: 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...
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.