ragtek
01-31-2009, 01:19 PM
ATM i'm using this code to insert a form with ajax:
$xml->add_tag('template','<form id="inviteform"><input type="text" name="invitevalue"><input type="button" id="sendinvite" value="aktualisieren" /></form>');
I'd like to make it without an request, so i'd like to make it with this method(only javascript).
this.inputobj = document.createElement('input');
this.inputobj.type = 'text';
this.inputobj.size = 50;
// read in value for titlemaxchars from $vbulletin->options['titlemaxchars'], specified in template or default to 85
this.inputobj.maxLength = ((typeof(titlemaxchars) == "number" && titlemaxchars > 0) ? titlemaxchars : 85);
this.inputobj.style.width = Math.max(this.linkobj.offsetWidth, 250) + 'px';
this.inputobj.className = 'bginput';
this.inputobj.value = PHP.unhtmlspecialchars(this.linkobj.innerHTML);
this.inputobj.title = this.inputobj.value;
// ... and event handlers
this.inputobj.onblur = vB_AJAX_ThreadList_Events.prototype.titleinput_onb lur;
this.inputobj.onkeypress = vB_AJAX_ThreadList_Events.prototype.titleinput_onk eypress;
// insert the editor box and select it
this.editobj = this.container.insertBefore(this.inputobj, this.linkobj);
this.editobj.select();
// store the original text
this.origtitle = this.linkobj.innerHTML;
// hide the link object
this.linkobj.style.display = 'none';
// declare that we are in an editing state
this.editstate = true;
Could somebody post me the code for this?
$xml->add_tag('template','<form id="inviteform"><input type="text" name="invitevalue"><input type="button" id="sendinvite" value="aktualisieren" /></form>');
I'd like to make it without an request, so i'd like to make it with this method(only javascript).
this.inputobj = document.createElement('input');
this.inputobj.type = 'text';
this.inputobj.size = 50;
// read in value for titlemaxchars from $vbulletin->options['titlemaxchars'], specified in template or default to 85
this.inputobj.maxLength = ((typeof(titlemaxchars) == "number" && titlemaxchars > 0) ? titlemaxchars : 85);
this.inputobj.style.width = Math.max(this.linkobj.offsetWidth, 250) + 'px';
this.inputobj.className = 'bginput';
this.inputobj.value = PHP.unhtmlspecialchars(this.linkobj.innerHTML);
this.inputobj.title = this.inputobj.value;
// ... and event handlers
this.inputobj.onblur = vB_AJAX_ThreadList_Events.prototype.titleinput_onb lur;
this.inputobj.onkeypress = vB_AJAX_ThreadList_Events.prototype.titleinput_onk eypress;
// insert the editor box and select it
this.editobj = this.container.insertBefore(this.inputobj, this.linkobj);
this.editobj.select();
// store the original text
this.origtitle = this.linkobj.innerHTML;
// hide the link object
this.linkobj.style.display = 'none';
// declare that we are in an editing state
this.editstate = true;
Could somebody post me the code for this?