Update TextField value with javascript


Can the
Window.executeJavaScript(String script)
used to update a textfield value. Something like this

		username   = new TextField();
		password   = new TextField();
				"username.value = readCookie('uname');"

Not sure how to get the dom id for username field. Can someone help?

Why would you like to update a textfield with javascript? Why not just
read the cookie on the server-side
and say username.setValue(theNameOfTheUserReadFromCookie)?

Also you might want to consider using LoginForm that allows the browser to use remember passwords and usernames for your application.


Can we run the Java Script and get the array from it and assign it to any variable using Vaadin?