Selecting Text So It STAYS Selected.

Jul 23, 2005

I have a textarea and some buttons. The buttons apply functions to
the text the user selects, i.e. the good old "wrap with a tag"
thing we all have seen in 100 different editors.

Trouble is, when I click the button, the selected text gets
unselected. Select some text in the textbox and click -anywhere-
and the text unselects.

View 7 Replies


ADVERTISEMENT

Read A Value From Text Box And Set A Session Type Var That Stays After Refresh?

May 15, 2009

I'm presently working on an existing web mapping site written in 'old' asp (not .net) using JavaScript on server side and JavaScript on client.

I'm more familiar with .net and vb, rusty with both 'old' asp and JavaScript so please forgive me if this question is too easy!

I need to set variables from web page tools, (e.g. a combo box) that have been coded in client JavaScript then save those variable back to the server as something like a session or application var. As when the page is refreshed (every time the map is paned for e.g.) I need the selected variable to stay and not have the user have to reset it every time.

I havent posted any code as I dont real know where to start!

I have no problem passing session vars from asp to the page but not collecting data from the page and saving back to server.

View 1 Replies View Related

Change Selected On Dropdown When A Text Form Is Selected Or Input Is Added?

May 19, 2010

like for example i have text areas named upload1 and upload2when I click or add input on upload1 a drop down list below upload2 will not change, but when I add input on upload2 the dropdown will select "parts"

View 3 Replies View Related

Selecting Text At The Cursor

Aug 14, 2006

Can anyone show me how to select text before or after a cursor in a
textarea or an RTE?

View 2 Replies View Related

Selecting Highlighted Text

Aug 11, 2006

It needs to allow the user to highlight some text within a paragraph. If the correct text (with an error) is selected it should provide feedback that the user has correctly selected this text.

So what I need to do is

1. Get the text selection
2. Compare this text selection to a predefined answer
3. Provide feedback to the user e.g. they are correct if text selection = predefined answer, and incorrect if text selection != predefined answer

View 3 Replies View Related

Selecting Text From A Txt File ?

Feb 5, 2011

Im trying to make an application that selects phrases from a txt file using a random number generator. im good with js but for some reason im drawing a blank...

View 1 Replies View Related

Selecting Text On A Page?

Apr 13, 2011

I have seen the "Select All" button or "Highlight All" button on numerous sites in the way of selecting text in a form field, but what I am wanting to do is with a button select all text in a table so all the viewer needs to do is press CRTL+C to copy the text. I have tried javascript:document.MyTable.select(); but it doesn't work. It really isn't an option for me to use a text box for the data as it is being formed dynamically in a table from a database.

View 3 Replies View Related

Get The Cursor Start And End Position Of A Selected Range In A Text-field Or Text-area

Jun 17, 2010

I want to get the cursor start and end position of a selected range in a text-field or text-area. i tried lot of functions in various forums. but when the last character of the selection is a new line character JavaScript ignore it in IE6. any one having idea ?

View 1 Replies View Related

Prevent User From Selecting Text??

Jul 23, 2005

I'm desinging a graphical interface and I frequently take advantage of the double click event. Unfortunately in most browsers double clicking also involves selecting and I would like to avoid that since whatever is selected has dark blue background and white letters what spoils the whole visual effect.... Any way I can block it por avoid it?

View 3 Replies View Related

Auto-selecting All Text In A Field

Nov 28, 2006

I have a simple form that contains an INPUT element that has an initial value.

<form name="Form">
<input name="Number" type="text" value="Hello">
</form>

When the form loads, I want all of the text in the field to be automatically selected. How can I do this?

Doing a:

document.Form.Number.select();

selects the INPUT element itself, not the text inside of it.

View 4 Replies View Related

JQuery :: Selecting Only The Text Within An Anchor?

Aug 29, 2011

<a href="google.com" id="test"><span>0</span>The text that I actually want</a> Using JQuery I want to be able to select "The text that I actually want". $('#id').text // outputs 0The text that I actually want Is there a way to accomplish this?

View 6 Replies View Related

JQuery :: Selecting Text Without Tags?

Jul 29, 2009

I have the following HTML (generated by a CMS):

<div id="breadcrumbs">
<a href="/" class="selectedPageRoot">Home</a>
Our Partnership & Services
</div>

how to select the text "Our Partnership..." inside of $("#breadcrumbs").

View 10 Replies View Related

Selecting A Dropdown Option By Its Text?

Jul 15, 2009

So I've got some simple javascript functions to set dropdown selections based on index. But I've also have a field that needs to be selected based on its text (possibly value, but text would be better).The current code is really just based around this line:document.getElementById("Option3")[myOption1].selected = true;and what I'm looking for is:document.getElementById("Option3").getIndexByText("TheSelectorText").selected = true;Is there a built in function for this? Has anyone implemented it? I searched google and there didn't seem to be any standout answers.

View 1 Replies View Related

Show Text Box When Check Box Is Selected + View Text Box

Nov 4, 2011

I wanted to show text box when check box is selected , it doesnt work...

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<script type="text/javascript" src="jquery.js"></script>
[Code]...

View 3 Replies View Related

Wrapping Tags Around Selected Text In A Text Area!!

Jun 16, 2006

I'm trying to 'wrap tags' around text in a text box.

<script language=javascript>
function insertFauxTags(fauxTag, e, endFauxTag)
{
var e = document.frmAddNewForum.txtTopicMessage.selected;
document.frmAddNewForum.txtTopicMessage.Value += fauxTag + e + endFauxTag;
}
</script>

And my form:

<form runat="server" id="frmAddNewForum">
<asp:textbox id="txtTopicMessage" runat="server" cssclass="formtext" rows="5" textmode="MultiLine" width="95%" style="width:95%"></asp:textbox>
</form>

And here's how I'm calling the function:

<a href="javascript:insertFauxTags('[p]' + e + '[/p]')"><img src="http://www.<%=strSiteName%>/images/parabutton.gif" border="0" alt="Paragraph" /></a>
When I run this in FF I get 'e' is not defined - any ideas?

View 1 Replies View Related

JQuery :: Selecting Lowest Element Containing Text?

May 28, 2009

I need to select the lowest element containing a given string.The :contains(text) selector returns the element I want but also allits ancestors (since they too contain the text). I haven't been ableto figure out a selector expression that returns only the lowestelement.

View 1 Replies View Related

JQuery :: Selecting A Input Text Within A Table?

Sep 26, 2011

Here is my HTML

<table bindtype="spinner" class="keypadfield" spinnermin="0" spinnermax="9" spinnerdefault="5" bindname="seg12dtm" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<input name="seg12dtm" type="text" class="inputnumericupdown" id="txtseg12dtm" maxlength="1">
</input>

[Code]...

View 1 Replies View Related

JQuery :: Selecting Text Part Of 'a' Element?

Nov 12, 2011

You can't select the 'text' part of an 'a' element with css, e.g. in the statement <a>some text </a> you can't use a css attribute selector a[text = "some text"]{} to style the 'a' element. You can select all named attributes such as HREF, TITLE, etc. Does jquery's .attrib map strictly to the css usage or is there some way I can match on that part of an 'a' element?

I need this because a menu list I'm working with doesn't by default require a TITLE element so I can't assume I can match on this attribute.

View 6 Replies View Related

Pull Down Replaced By Text Field When Selecting Other

Feb 2, 2010

Objective:
- when you select other the pull down menu is replaced by the text field.
Currently:
- Gotten it to the level of when you select the other the text field appears.
Question:
- HOw can I modify the code so when I select the other menu option from the pull down menu and it replaced by the text field?

<script type="text/javascript">
function togglefield(val) {
var o = document.getElementById('other');
(val == 'Other')? o.style.display = 'block' : o.style.display = 'none';
}
</script>
and the form:
<form action="" method="post">
<select name="sel" id="sel" onChange="togglefield(this.value);">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="Other">Other</option>
</select>
<input type="text" name="other" id="other" style="display: none;">
</form>

View 4 Replies View Related

Onkeyup And Selecting Input Type Text Value

Jul 31, 2011

I'm trying to access a value from an input form. I know this works without the onkeyup event but with it it says the that document.formname.elementid.value is undefined! Its extremely frustrating. As the user types into the input, I am using AJAX to generate some more options which works but I need to be able to access the input type=text value.

View 3 Replies View Related

Text Field Required Only On Selecting Checkbox?

Apr 6, 2011

I have an html form that has required feilds. The telephone field needs to be required only when a certain checkbox is selected.

View 14 Replies View Related

Changing Text Upon Selecting From A Drop-down Menu?

Feb 28, 2010

On a page for product descriptions, I have a MySQL query that returns a list of purchase options and the price of each option.There is a drop-down field which lists the names of each option. To the right, the price of the selected option is displayed.Upon selecting a different option, how can I have the displayed price change to that of the newly selected option?

View 2 Replies View Related

Passing The Selected Text From List Into Text

May 24, 2010

I want passing the selected text from list into text. i dont know how to do nu. I attached screenshot with this thread.

View 7 Replies View Related

Text In Text Box Has Been Selected Forwards Or Backwards?

Aug 16, 2010

Is there a way to tell if the text in a text box has been selected forwards or backwards?If you select some text from left to right and then hold down shift and use the cursor keys the right end of the selection moves. If you select some text from right to left and then hold down shift and use the cursor keys the left end of the selection moves.Is there a way in Javascript to detect which way the text has been selected? I need to know if the "end" position is before the "start" position or after. Using ranges and selection objects seems to "normalise" the selection so that the start is before the end.

View 2 Replies View Related

JQuery :: Including External Pages / Selecting Text Fragments?

Jan 9, 2011

I want users to specify external sites, a) include them, and let b) users annotate certain paragraphs of text.

a)

As this sites are external (not on the same domain) I cannot use iframes since I cannot select text then, as I understood, right? So I need to create a proxy page which integrates them in the local domain. If this works, I guess the problem are relative urls - does anyone know a good way to correct these? Furthermore, do I need an iframe, or is there another way?

b)

I would like users to be able to select text paragraphs and add a description. Ideally I would get XPath for the selection. Is there a tool/plugin to do this? Like select some text and get the XPath for it?

View 1 Replies View Related

Drop Down Menu Stays Down On Mouseout

Mar 8, 2010

Using a css dropdown menu with javascript work-around for ie. Sorry to post yet again on this subject, but I couldn't find a solution in previous threads. My problem (in IE): I'm using the workaround as detailed in the "suckerfish" article [URL]. Works great to drop my menu down, but when I mouse out the menu remains. On checking back with the original article, they have the same problem so I tried adapting the mouseout line in different ways. Still can't figure it out. Here is my site: [URL]

Drop down menu only exists for the "producers directory".

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved