Click here to Skip to main content
15,927,593 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: how to use javascript with masterpage in asp.net2.0? Pin
pmarfleet1-Mar-08 1:38
pmarfleet1-Mar-08 1:38 
QuestionProblem With AddHeader in modalDialog.. Pin
Arun Jacob29-Feb-08 22:51
Arun Jacob29-Feb-08 22:51 
GeneralJavascript validation(s) Pin
.NET- India 29-Feb-08 22:38
.NET- India 29-Feb-08 22:38 
GeneralRe: Javascript validation(s) Pin
Christian Graus29-Feb-08 22:46
protectorChristian Graus29-Feb-08 22:46 
GeneralRe: Javascript validation(s) Pin
.NET- India 29-Feb-08 22:54
.NET- India 29-Feb-08 22:54 
GeneralRe: Javascript validation(s) Pin
Christian Graus29-Feb-08 23:00
protectorChristian Graus29-Feb-08 23:00 
GeneralStop asking the same question Pin
Not Active1-Mar-08 2:06
mentorNot Active1-Mar-08 2:06 
Questioncan we set value of a text box from selection of items from the listbox by javascript Pin
Vishnu Narayan Mishra29-Feb-08 21:05
Vishnu Narayan Mishra29-Feb-08 21:05 
Hi all,
How can I set value of a text box from selection of items from the asp listbox or we can use any html control by javascript, since selectedIndex not working for the list box.. following is the code...

]]>





<title>State Management


function ShowList()
{
document.getElementById('helptypediv').style.visibility='visible';return false;
}
function HideList()
{
document.getElementById('helptypediv').style.visibility='hidden';return false;
}
function ShowText()
{
var txtMessage = document.getElementById('lstShowHistory').options[selectedIndex].text; //Not Woking selectedIndex here
document.getElementById('txtUrlLink').value = txtMessage;
document.getElementById('helptypediv').style.visibility='hidden';return false;
}







<asp:textbox id="txtUrlLink" runat="server" width="200px" cssclass="DataEntry">

<asp:listbox id="lstShowHistory" runat="server" cssclass="DataEntry" width="200px">
<asp:listitem selected="True">Url Name 1
<asp:listitem>Url Name 2
<asp:listitem>Url Name 3

<%--
Url Name 1
Url Name 2
Url Name 3
--%>







CS File Code

I have the following code on page load event of the page..

lstShowHistory.Attributes.Add("onchange", "ShowText();");

Vishnu Narayan Mishra
Software Engineer

AnswerRe: can we set value of a text box from selection of items from the listbox by javascript Pin
Christian Graus29-Feb-08 21:50
protectorChristian Graus29-Feb-08 21:50 
GeneralForm Authentication Help Required [modified] Pin
Mujahid Ullah Shaik29-Feb-08 20:22
Mujahid Ullah Shaik29-Feb-08 20:22 
GeneralRe: Form Authentication Help Required Pin
Christian Graus29-Feb-08 21:51
protectorChristian Graus29-Feb-08 21:51 
Questionasp.net Pin
venkat2429-Feb-08 20:20
venkat2429-Feb-08 20:20 
GeneralRe: asp.net Pin
sulabh202029-Feb-08 20:28
sulabh202029-Feb-08 20:28 
GeneralRe: asp.net Pin
yogesh_kumar_agarwal29-Feb-08 20:46
yogesh_kumar_agarwal29-Feb-08 20:46 
GeneralRe: asp.net Pin
Christian Graus29-Feb-08 21:46
protectorChristian Graus29-Feb-08 21:46 
GeneralProblem in selecting a item in dropdown list box of a .aspx page.. Pin
Balagurunathan S29-Feb-08 20:19
Balagurunathan S29-Feb-08 20:19 
GeneralRe: Problem in selecting a item in dropdown list box of a .aspx page.. [modified] Pin
Mujahid Ullah Shaik29-Feb-08 20:27
Mujahid Ullah Shaik29-Feb-08 20:27 
GeneralRe: Problem in selecting a item in dropdown list box of a .aspx page.. Pin
Christian Graus29-Feb-08 21:53
protectorChristian Graus29-Feb-08 21:53 
GeneralRe: Problem in selecting a item in dropdown list box of a .aspx page.. Pin
Balagurunathan S2-Mar-08 19:08
Balagurunathan S2-Mar-08 19:08 
Generalencoding Pin
ptvce29-Feb-08 19:02
ptvce29-Feb-08 19:02 
GeneralRe: encoding Pin
yogesh_kumar_agarwal29-Feb-08 19:08
yogesh_kumar_agarwal29-Feb-08 19:08 
General[Message Deleted] Pin
.NET- India 29-Feb-08 17:55
.NET- India 29-Feb-08 17:55 
GeneralRe: Javascript Validation Pin
Not Active29-Feb-08 18:04
mentorNot Active29-Feb-08 18:04 
GeneralRe: Javascript Validation Pin
.NET- India 29-Feb-08 18:08
.NET- India 29-Feb-08 18:08 
GeneralRe: Javascript Validation Pin
Not Active29-Feb-08 18:10
mentorNot Active29-Feb-08 18:10 

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.