Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > HtmlSelect control is not helping and client side coding became a real headache

Reply
Thread Tools

HtmlSelect control is not helping and client side coding became a real headache

 
 
Suhail A, Salman
Guest
Posts: n/a
 
      08-13-2003
Dear All,

I placed a HtmlSelect control on a web page and set "Run at Server", the
objective of this list box is that the client adds all his accounts to this
text box, and because this is a client side operation / no server
intervention is required, I wrote the JavaScript below to add account number
entered in a text box to the list control, this works fine, the client can
enter all his accounts to the html select control, the problem is that when
the page is posted to the server the code within the server returns no items
within the control so I have lstCustAcc.Items.Count = 0 even on the page it
contains some thing else >0, and I could not access any item within the
control.

PLEASE HELP.


function AddAcc()
{
var lstLen = document.Form1.lstCustAcc.length;
var selectedText = document.Form1.txtAccountNo.value;
var selectedValue = document.Form1.txtAccountNo.value;
var i;
var isNew = true;

if (lstLen != 0)
{
for (i = 0; i < lstLen; i++)
{
thisitem = document.Form1.lstCustAcc.options[i].text;
if (thisitem == selectedText)
{
isNew = false;
break;
}
}
}
if (isNew)
{
newoption = new Option(selectedText, selectedValue, false, false);
document.Form1.lstCustAcc.options[lstLen] = newoption;
}
document.Form1.lstCustAcc.selectedIndex=-1;
}





Thanks in advance,
Suhail


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Windows 7, a REAL HEADACHE Rajinder Nijjhar Computer Support 29 05-10-2010 10:57 AM
HtmlSelect control not showing ListItems =?Utf-8?B?Sm9l?= ASP .Net 3 12-14-2005 09:40 PM
Problem with HTMLSelect.SelectedIndex and client disabled property Harry Keck ASP .Net Web Controls 0 01-27-2005 03:19 PM
VS.NET 2003 debugging became very slow after installing VS6 side by side Andy Chau ASP .Net 0 11-20-2003 01:19 AM
HtmlSelect or ListBox control Alex ASP .Net Web Controls 0 09-12-2003 02:52 AM



Advertisments