Getting textbox value with Dojo

ckadi

New Member
Ok, I would think something like this would be incredibly simple, but apparently nothing in Dojo is simple. I'm on the verge of just dumping this thing. It's a nice idea, but I found C# and OOP easier than this. I've tried getting the value of the AddressModel_ZipCode textbox multiple ways now. Every time I am pulling null on it. I've also tried using dom-attr to no avail. Can anyone see where the hell I'm going wrong here? Thanks.\[code\] require(["dojo/dom", "dojo/dom-style", "dojo/request"],function (dom, domStyle, request) { window.getZipCode = function () { var zipcode = dom.byId("AddressModel_ZipCode"); alert(zipcode.get("value")); request.post("../PricingRequest/custinfozip", { data: { zipCode: zipcode } }).then(function (response) { dom.byId('custinfozip').innerHTML = response; var zipErrorMessage = dom.byId('zipErrorMessage'); if ('@Model.AddressModel.ErrorMessage' != null) { domStyle.set(zipErrorMessage, 'display', 'inline'); } else { domStyle.set(zipErrorMessage, 'display', 'none'); } }); }});\[/code\]
 
Back
Top