Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do use dojo TextBox attr function to get value?

Tags:

dojo

How can i get the value of a Dojo TextBox?

Am doing this;

dijit.byId("textName").getValue();

But firbug tells me getValue() is deprecated! is use attr('value')!

but i have no clue on how to use attr('value') function

Help

Gath

like image 211
gath Avatar asked Apr 09 '09 18:04

gath


2 Answers

Starting with Dojo 1.5 you should use the get and set methods to fetch and set properties. But the attr method is still working until Dojo 2.0 is out.

var box = dijit.byId('textbox')
box.get('value');
box.set('value', 'new value');
like image 73
David Raab Avatar answered Sep 27 '22 19:09

David Raab


I've done this and its working;

var titleEdit = dijit.byId('title');

var myValue = title.attr('displayedValue');

worked!

like image 43
gath Avatar answered Sep 27 '22 20:09

gath