Hey all, I have an object question for you. I have created this object to dynamically create a dojo widget (dijit) and I need to change the onChange Part.
as you see I have hard coded the 'onChange': function(){ wasChanged(newDivId);}, in the wrapper. I would like to pass a new function location like goHere(newDivId). How do I do that? DO I have go add goHere(newDivId) into a new object and pass that object to the wdge.txtValidation? I know that I am using dojo but this is a Javascript question.
Thanks,
timgerr
-How important does a person have to be before they are considered assassinated instead of just murdered?
-Need more cow bell!!!
Code:
var wdgt = {
//----------------------------------------------------------------------------------------------------------------------------------------
// txtValidation
// This will validate data that is contained within a textbox
// newDivId = This is the name of the new div id
// putDivId = This is the name of the div id that we are going to put this html object
// maxLen = This is the length that the input box will allow
// regEp = This is the regular expresion that must happen before any of the data will be processes
// pCase = This is if propercse (meaning the first letter is uppercase) true for yes or blank for no
// errMsg = This is the error message if the data does not meet the regular expression
//----------------------------------------------------------------------------------------------------------------------------------------
txtValidation : function (newDivId,putDivId,maxLen,regEp,pCase,errMsg){
var textArea = new dijit.form.ValidationTextBox({
'id':newDivId,
'class':'medium',
'name':newDivId,
'required':"true",
'maxlength':maxLen,
'trim':'true',
'regExp':regEp,
'propercase':pCase,
'onChange': function(){ wasChanged(newDivId);},
'invalidMessage':errMsg
},document.createElement("div"));
dojo.byId(putDivId).appendChild(textArea.domNode);
}
}
Thanks,
timgerr
-How important does a person have to be before they are considered assassinated instead of just murdered?
-Need more cow bell!!!