I was wondering how you allow the user to highlight text they've typed (in a form) and click a button to edit its style (placing tags around the highlighted text).
Could someone explain this a little further and perhaps provide an example.
1) search the database for the words user is typing in the text box. This will happen with each key press.2) if there is a match - I need to change the text color.
Alright, I'm using a Rooh.It WordPress plugin right now, but I don't like the way they do it, so I want to write my own code to do something similar.
I want the user to be able to select the text they want to highlight, and the background color of that text changes to whatever color they have selected.
I am using a calendar control based on the one at Brainjar.com. I have made the text field into which the date is inserted readonly. The problem with this is that if a user attempts to change the date manually by deleting part of the highlighted text, the browser goes back one page.
I want to force the user to use the calendar control and not input text directly into the textfield- readonly is not enough as the text can still be highlighted and then causes problems if the user attempts to delete.
I'm trying to write an application to demonstrate to a friend how to highlight text in javascript, only problem is he wants it to be on divs only.
So say for example you have a page, and you select some text in the div (this is static text, not a form or anything) and you click "highlight" is there a way to wrap style tags around that highlighted text using javascript, without refreshing the page?
et me know how can I highlight a selected portion of an html document with javascript such that the selected portion is repeatedly shown highlighted on each and every page refresh.
I'm trying to write a function that is similar to the ctrl+f functionality you get in IE, where you have a search string and when you click 'next' the whole string if matched is highlighted by the cursor.
This works fine for inputs and text areas using the following code:
But now I need to get it to work for normal text in a text node that is in the HTML/DOM. Is there an equivalent way of making the above method work for text in text nodes?
Alternatively is there a way to make the browser (IE) at least focus on some text in a text node? (I could then highlight it with CSS styles).
The first page with the menu works just fine, but when you go to any of the other pages it won't let you highlight the text to copy and paste - in certain circumstances. It works fine on my home computer which is running Windows XP. I've been able to work with it in all browsers. On Windows Vista and Windows 7 there are issues. The only real difference is the previous/next page menu and the switch div script which is written in Javascript. This is the only thing I can think that's interfering. I've only tested Internet Explorer and Chrome in Vista (don't know about Chrome in 7) but it inhibits in both browsers.
Might there be any work arounds? On 14.html which is the Index (as in book, not the main web page) the switch div is gone but it's still not working. However, I tested just the switch div script on another web-site without the previous/next page menu and that also doesn't work.
i am creating a search method tht searches the string entered in the text box in the given page having table. i want to highlight the found word ( matching part )... but i dont kw hw to exactly get the table colums and apply the highlight method
i am creating a search method tht searches the string entered in the text box in the given page having table. i want to highlight the found word ( matching part )...i can do that but with createTextRange its getting the first match word and than exits
is it possible to create certain part of the page and not the whole page(document.body.createTextrange()) for search like only one column of table and not the whole page contents
Why do the API docs keep changing format? Can we keep them in the old more organized format? Having a giant list of methods makes it difficult to find information.
I'm currently working on a project which is essentially a clickable world map. I have successfully mapped the image and using a OnMouseOver = "Continent()" OnMouseOut = "World()" command in each mapping line ie. <area shape="poly" onmouseover="NA()" onmouseout="World()" coords="(lotsonumbers)".
In my continent functions I change the image using something like: function Africa() {document.images[35].src="/_View/images/maps/worldmaps/world.africa.jpg"; return true;}
This gives me the "highlighting" effect I was looking for when people mouse over the continent.
However! my problem now is that I need to find a way to essentially link that with a cell within the same table as the mapped image. There is a list of the continents in the column next to the map (the map has all the rows merged in that column). I need it so that if I run the mouse over the continent or that cell both of them highlight at the same time. I see the best way of doing this as having both call the World or Continent function. However I have been unable to find any way of setting a specific cell's background or text from within a function.
I've been struggling with this for days. How can I use javascript to high light a part of the text in a textbox or a textarea?
OR
if the user highlights a part of the text in a textbox or a textarea, how can I say which part of the text is highlighted? (ie: at what character the highlight starts and at what character the highlight ends).
I am a complete novice when it come to Javascript. I copied the script for displaying random images at a specific interval (from javascriptkit.com). I would appreciate knowing whether the following is possible:
The pages are based on tables, so the parts that change are all cells.
1. Can I define text instead of an image in the array? i.e. can I have the image change to say an apple in one cell and the next cell have text explaining what an apple is?
2. Would it be possible to put a countdown timer for when the image/text is going to change?
I found this slide show [URL]. I got it to work on my website [URL] using Firefox, but when it is viewed in Internet Explorer it will not work. Second question, When the slide show gets to the last image, after the last image all photos disappear and it resets itself changing the format of the webpage. Any way to not have the images disappear while it loops itself or is there a code to have it stop on the last photo and not loop.
<script type=text/javascript> function hide_tooltip(){ var hp = document.getElementById("tooltipper"); hp.style.left=0; hp.style.top=0; hp.style.width=1; hp.style.height=1; hp.style.padding=0; hp.style.border=0; hp.innerHTML=""; } function show_tooltip(event,wid,ht,txt){ var vp=document.getElementById("tooltipper"); vp.style.border="1px solid black"; vp.style.left=event.clientX+25; vp.style.top=event.clientY-1; vp.style.width = wid; vp.style.height = ht; vp.style.padding=10; vp.innerHTML=txt;
}
</script>
</head>
<body> <BR><BR> <form>
<a href=# onmouseover="javascript:show_tooltip(event,400,10,'This is an input text box that you need to fill in.');" onmouseout="javascript:hide_tooltip();" style='color:red'><input type=text name='bob'></a> </form> <div id='tooltipper' style='position:absolute;left:0;top:0;width:1;heig ht:1;border:0;background-color:rgb(250,250,255)'></div> </body></html> ===================================== Question:... Is there any way to insert a NewLine in the text string to control the formatting of the text in the window??
I have a web form. I use a simple function to generate a letter ouput based on the form fields and populate them into a word doc for printing. Below is a basic example, but you get the idea.
Note this is only intended to be used on IE8. As it stands, the ouput generates and formats exactly as I want bar two things:
1) Does anyone know how I can get some of the text to bold? I've tried everything I can think of (html tags, escape characters etc etc). Is there a way to open a word window in rtf perhaps?
2) Does anyone know how I can insert a small image (a signature in gif or jpg) into the document?
I can use a browser window instead of word, which formats, bolds, images etc, however I then get the issue of headers/footers when printing. I cannot disable headers everytime I want to print a letter, it's not practical.
I have the following script that converts line breaks from plain text into HTML formatted paragraphs. It takes plain text from one text area field and outputs the new formatted text into another text area field.
function convertText(){ var noBreaks = document.getElementById("oldText").value; noBreaks = noBreaks.replace(/
I'm trying to reduce the height of input buttons, but am unable to center the text vertically. Tried every css trick I know, but the text is still too low (I can make it lower :P). Any way to do this?
I have a database script that returns dates in the following format:
yyyy-mm-dd
I have been using the following code to change this format to dd-mm-yyyy:
<script type="text/javascript"> var myString = "[[date]]"; var mySplitResult = myString.split("-");document.write(mySplitResult[2] + "/" + mySplitResult[1] + "/" + mySplitResult[0] ); </script>
However, I now want to display the date in text format, e.g. 01-08-2009 would be displayed as 01 August 2009.how I change the script to show this format?