ListBox and Javascript

  • Thread starter Thread starter Henrik Holle
  • Start date Start date
H

Henrik Holle

Hi,

i have a serverside listbox but i modify the value with javascript on the
clientside. On postback my changed/added values are all lost? what am i
doing wrong? Is it not possible to change the listbox content on the
clientside?

regards

henrik
 
you can add the values to a list box using javascript.
alternatively you can keep a hidden textbox and add the value of the item
addded to the listbox as a comma seperated value and get these values at the
server side.
HTH
srini
 
Not if the listbox is being re-created from viewstate (which is probably
what's happening). The only solution I know of is when the submit button is
clicked, to highlight all items in the listbox and use good'ol Request.Form
to access the values..

Karl
 
Are you populating the listbox in the PageLoad method? If so you'll need to test for
postback before populating listbox.



| Hi,
|
| i have a serverside listbox but i modify the value with javascript on the
| clientside. On postback my changed/added values are all lost? what am i
| doing wrong? Is it not possible to change the listbox content on the
| clientside?
|
| regards
|
| henrik
|
|
 
ok, i build a workaround with a hiddenfield and onsubmit/postback i am
parsing the values and add the listitems by hand.

thx for your help
 
Back
Top