manipulating textbox value
Posted
by chameios
on Stack Overflow
See other posts from Stack Overflow
or by chameios
Published on 2009-07-31T23:29:09Z
Indexed on
2010/04/12
3:03 UTC
Read the original article
Hit count: 411
hello All,
I am new to the programming world of dojo and web applications. I am trying to acomplish a task where I want to manipulate the textbox value with some text. I tried everything including some code from dojocampus, but even this code doesnot do anything. I have also tried to create an instance , with dojo.widget.byId and dijit.byId and then tried the instance.value = 'newtext' and everything that I could find but for some reason , the textbox is not updating. Please help me.
<html>
<head>
<title>Dojo example</title>
<style type="text/css">
@import "pathtodojo/dijit/themes/nihilo/nihilo.css";
</style>
<style type="text/css">
</style>
<script type="text/javascript" src="pathtodojo/dojo/dojo.js" djConfig="parseOnLoad:true, isDebug: true"></script>
<script>
dojo.require("dijit.form.TextBox");
function init() {
var box0 = dijit.byId("value0Box");
var box1 = dijit.byId("value1Box");
box1.attr("value", box0.attr("value") + " modified");
dojo.connect(box0, "onChange", function(){
box1.attr("value", box0.attr("value") + " modified");
});
}
dojo.addOnLoad(init);
</script>
<body class="nihilo">
A textbox with a value: <input id="value0Box" dojoType="dijit.form.TextBox" value="Some value" intermediateChanges="true"></input>
<br>
A textbox set with a value from the above textbox: <input id="value1Box" dojoType="dijit.form.TextBox"></input>
<br>
</body>
</html>
regards C
© Stack Overflow or respective owner