Code:
function set_var(name, value){
if(this.form.getElementById('name') != null){
this.form.getElementById('name').value = value;
} else {
this.create(name, value);
}
}
function present_vars(){
var returnstring = '';
var count = this.form.length;
for(index=0; index<count; index++){
returnstring = returnstring + '&' + name + '=' +
this.form.elements[index].value;
}
return returnstring;
}
function present_vars(name){
return '&' + name + '=' + this.form.getElementById('name').value;
}
function create_var(name, value){
var input = document.createElement('input');
input.setAttribute('type', 'text');
input.setAttribute('value', value);
input.setAttribute('name', name);
input.setAttribute('id', name);
//input.setAttribute('disabled', 'disabled');
this.form.appendChild(input);
}
function variables_handler(form_id){
this.form = document.getElementById(form_id);
this.set = set_var;
this.present = present_vars;
this.create = create_var;
}
function query(){
var variables = new variables_handler('variables');
var queryString = variables.present();
var queryaction = variables.present('queryaction');
ajaxFunction('_self', 'query', queryString, query_ORSC, 'text');
}
ajaxFunction works.
My expectation is that when I call query, query will instantiate the variables_handler object then use it,
but the present function is returning undefined.
Thank you,