javascript - Textbox is not taking the value that I assign -


i have page 10 inputs (textbox). set each input value in page_load with

txtcolor.text = "#ffffff" 

each input color picker. when user pick color, hexa-name set in textbox javascript piece of code:

document.getelementbyid(txtcolor).setattribute("value", newcolor); 

buuuuuuut when try save changes dont know why values saved old ones.

if @ first value "ffffff" user chose "000000" program ignores , save "ffffff" in db.

i'm working vb.net

i appreciate kind of help!

edit: oh god, of course thing tim medora say. put 'not ispostback' , works fine.

thanks lot, wasnt able see error.

you you're using vb script, post tagged javascript. it's not clear you're working with, in javascript i'd this:

colorpicker = document.getelementbyid("color-picker"); colorpicker.addeventlistener("change", function () { updatetextbox(); }); textbox = document.getelementbyid("text-box"); function updatetextbox() {     textbox.value = colorpicker.value; } 

hope helps...


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -