senior01
01-06-2015, 01:06 PM
Hello,
this is exacly the code what i need for my new template.
on my new template i need to place two buttons to work whit them.
i hang on one row an dont understand, why getElementsByTagName don't to find the "form" TAG?
Answer from C.responseXML.getElementsByTagName('team_template")[0].firstChild.nodeValue
response = <form>
<fieldset>
<div>
<input type="text" class="primary textbox" name="postid[43473]" id="cfield_43473" value="Das Forum..." tabindex="1" maxlength="100" />
<p class="description">Das Forum</p>
<input type="hidden" name="postid[43473_set]" value="1" />
<div id="field_edit_error_container" class="hidden">
<img class="inlineimg" src="images/Seamus/statusicon/wol_error.png" alt="Fehler" />
<span id="field_edit_errors"></span>
</div>
<div>
<input type="submit" id="submitbutton" class="userprof_button" value=" Speichern " />
<input type="reset" id="cancelbutton" class="userprof_button" value="Abbrechen" />
<img class="hidden" id="field_edit_progress" src="images/Seamus/misc/progress.gif" alt="" />
</div>
</div>
</fieldset>
</form>
cmd:
this.element.innerHTML = C.responseXML.getElementsByTagName("template")[0].firstChild.nodeValue;
this.form = this.element.getElementsByTagName("form")[0];
for (var B = 0; B < this.form.elements.length; B++) {
if (this.form.elements[B].tagName == "INPUT" || this.form.elements[B].tagName == "SELECT" || this.form.elements[B].tagName == "TEXTAREA") {
this.form.elements[B].focus();
break
}
}
console.log:
vbulletin_team_edit.js?v=422:100 form? = undefined
vbulletin_team_edit.js?v=422:105 Uncaught TypeError: Cannot read property 'elements' of undefined
vbulletin_team_edit.js?v=422:64
if i change the tag from "form" to other tag like "p" then,
the log console says that they accept the other tag, but i need in this case the "form" tag.
If i try it to get it with "getElementbyID" or "getElementsbyID" it shows me the answer that the Function ist not defined,
console.log:
element = [object HTMLElement]
sorry for my bad english....
Best Regards,
Senior
this is exacly the code what i need for my new template.
on my new template i need to place two buttons to work whit them.
i hang on one row an dont understand, why getElementsByTagName don't to find the "form" TAG?
Answer from C.responseXML.getElementsByTagName('team_template")[0].firstChild.nodeValue
response = <form>
<fieldset>
<div>
<input type="text" class="primary textbox" name="postid[43473]" id="cfield_43473" value="Das Forum..." tabindex="1" maxlength="100" />
<p class="description">Das Forum</p>
<input type="hidden" name="postid[43473_set]" value="1" />
<div id="field_edit_error_container" class="hidden">
<img class="inlineimg" src="images/Seamus/statusicon/wol_error.png" alt="Fehler" />
<span id="field_edit_errors"></span>
</div>
<div>
<input type="submit" id="submitbutton" class="userprof_button" value=" Speichern " />
<input type="reset" id="cancelbutton" class="userprof_button" value="Abbrechen" />
<img class="hidden" id="field_edit_progress" src="images/Seamus/misc/progress.gif" alt="" />
</div>
</div>
</fieldset>
</form>
cmd:
this.element.innerHTML = C.responseXML.getElementsByTagName("template")[0].firstChild.nodeValue;
this.form = this.element.getElementsByTagName("form")[0];
for (var B = 0; B < this.form.elements.length; B++) {
if (this.form.elements[B].tagName == "INPUT" || this.form.elements[B].tagName == "SELECT" || this.form.elements[B].tagName == "TEXTAREA") {
this.form.elements[B].focus();
break
}
}
console.log:
vbulletin_team_edit.js?v=422:100 form? = undefined
vbulletin_team_edit.js?v=422:105 Uncaught TypeError: Cannot read property 'elements' of undefined
vbulletin_team_edit.js?v=422:64
if i change the tag from "form" to other tag like "p" then,
the log console says that they accept the other tag, but i need in this case the "form" tag.
If i try it to get it with "getElementbyID" or "getElementsbyID" it shows me the answer that the Function ist not defined,
console.log:
element = [object HTMLElement]
sorry for my bad english....
Best Regards,
Senior