Click here to Skip to main content
15,914,074 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: dropdown Pin
DJ Matthews27-Jan-10 10:20
DJ Matthews27-Jan-10 10:20 
GeneralRe: dropdown Pin
arkiboys27-Jan-10 21:46
arkiboys27-Jan-10 21:46 
Questiondocument.selection - not working in firefox Pin
sekannak27-Jan-10 0:21
sekannak27-Jan-10 0:21 
AnswerRe: document.selection - not working in firefox Pin
Prosanta Kundu online27-Jan-10 17:15
Prosanta Kundu online27-Jan-10 17:15 
GeneralRe: document.selection - not working in firefox Pin
sekannak27-Jan-10 17:56
sekannak27-Jan-10 17:56 
GeneralRe: document.selection - not working in firefox Pin
Prosanta Kundu online27-Jan-10 18:11
Prosanta Kundu online27-Jan-10 18:11 
GeneralRe: document.selection - not working in firefox Pin
sekannak27-Jan-10 18:52
sekannak27-Jan-10 18:52 
GeneralRe: document.selection - not working in firefox [modified] Pin
Prosanta Kundu online27-Jan-10 22:50
Prosanta Kundu online27-Jan-10 22:50 
Hi
here is your code

<pre>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Selection Test Page</title>
<script language="javascript" type="text/javascript">

function insertTextFun() {

if (document.selection)
{
document.getElementById("txtExprsn").focus();
var sel = document.selection.createRange();
var varname = document.getElementById("lsbFunction");
sel.text = varname.options[varname.selectedIndex].text;
document.getElementById("txtExprsn").focus();
}
else if (window.getSelection()) {
var input = document.getElementById("txtExprsn");
var varname = document.getElementById("lsbFunction");
var start = input.selectionStart;
var end = input.selectionEnd;
var insText = input.value.substring(start, end);
input.value = input.value.substr(0, start) + varname.options[varname.selectedIndex].text + input.value.substr(end);
input.selectionStart = start;
input.selectionEnd = (start + varname.options[varname.selectedIndex].text.length);
input.focus();

    
}
else
{
txtExprsn.value += lsbFunction[lsbFunction.selectedIndex];
}
}
</script>
</head>
<body >

<select id="lsbFunction" size=5 onclick="insertTextFun()">
<option value="function1">function1</option>
<option value="function2">function2</option>
<option value="function3">function3</option>
<option value="function4">function4</option>
<option value="function5">function5</option>
</select>

<textarea id="txtExprsn" rows="10" cols="40">
This is an example of [bla bla bla] selection.
</textarea>
</body>
</html>
</pre>

Cheers
Prosanta Kundu

modified on Thursday, January 28, 2010 5:04 AM

GeneralRe: document.selection - not working in firefox Pin
sekannak28-Jan-10 17:41
sekannak28-Jan-10 17:41 
QuestionWebPartZone Layout Orientation Pin
NTheOne26-Jan-10 22:40
NTheOne26-Jan-10 22:40 
Questioncould not access hiddenfield Pin
bhavna432126-Jan-10 22:28
bhavna432126-Jan-10 22:28 
AnswerRe: could not access hiddenfield Pin
Dinesh Mani26-Jan-10 22:54
Dinesh Mani26-Jan-10 22:54 
GeneralRe: could not access hiddenfield Pin
bhavna432126-Jan-10 23:05
bhavna432126-Jan-10 23:05 
GeneralRe: could not access hiddenfield Pin
Dinesh Mani26-Jan-10 23:26
Dinesh Mani26-Jan-10 23:26 
GeneralRe: could not access hiddenfield Pin
sekannak27-Jan-10 0:38
sekannak27-Jan-10 0:38 
QuestionPlay sound on Event Pin
bonkers12326-Jan-10 21:16
bonkers12326-Jan-10 21:16 
AnswerRe: Play sound on Event Pin
Pranay Rana26-Jan-10 23:42
professionalPranay Rana26-Jan-10 23:42 
GeneralRe: Play sound on Event Pin
bonkers12328-Jan-10 20:52
bonkers12328-Jan-10 20:52 
GeneralASP.NET CRM Pin
hussain.attiya26-Jan-10 21:07
hussain.attiya26-Jan-10 21:07 
AnswerRe: ASP.NET CRM Pin
Ashfield27-Jan-10 2:49
Ashfield27-Jan-10 2:49 
AnswerRe: ASP.NET CRM Pin
hussain.attiya27-Jan-10 2:57
hussain.attiya27-Jan-10 2:57 
GeneralRe: ASP.NET CRM Pin
Ashfield27-Jan-10 3:08
Ashfield27-Jan-10 3:08 
QuestionCrystal Report Error in web Application Pin
Dipal Panchal26-Jan-10 21:03
Dipal Panchal26-Jan-10 21:03 
AnswerRe: Crystal Report Error in web Application Pin
i gr827-Jan-10 2:36
i gr827-Jan-10 2:36 
QuestionCrystal Report height in ASP.net Pin
Hema Bairavan26-Jan-10 20:15
Hema Bairavan26-Jan-10 20:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.