Can someone tell me whats wrong with the code, it wont work..i have looked over it several times and i'm clueless on what could be wrong with it.
Code:
- <script type="text/javascript">
- <!--
- /* Predefined Posting Template/Form
- Created by Ross of vForums
- http://virtualforums.co.uk
- Please do not repost outside of
- vForums support without permission */
- var _title = 'Character Profile';
- var _description = 'Fill this out and post it to make your characters profile.';
- var _fields = new Array(); var _f = 0;
- _fields[_f++] = new Array('input', 'Character Full Name', ['size', 40, 'maxLength', 50], '', 'Your characters full name, first and last.', true);
- _fields[_f++] = new Array('input', 'Character NickName', ['size', 40, 'maxLength', 50], '', 'Character Nickname (If Doesnt Got One Just Put * )', true);
- _fields[_f++] = new Array('input', 'Character Age', ['size', 40, 'maxLength', 50], '', 'Put Your characters age here.', true);
- _fields[_f++] = new Array('input', 'Character Height', ['size', 40, 'maxLength', 50], '', 'Whats the height of your character?', true);
- _fields[_f++] = new Array('select', 'Character Gender', false, ['Male', 'Female'], 'Whats your characters Gender?', true);
- _fields[_f++] = new Array('select', 'Character Time', false, ['Japan', 'Feudal Japan'], 'What time is your character from? *Keep in mind that this sets where you can RP*', true);
- _fields[_f++] = new Array('input', 'Character Eye Color', ['size', 40, 'maxLength', 50], '', 'Whats your characters eye color?', true);
- _fields[_f++] = new Array('input', 'Character Hair Color', ['size', 40, 'maxLength', 50], '', 'Whats your characters hair color?', true);
- _fields[_f++] = new Array('input', 'Character Skin Color', ['size', 40, 'maxLength', 50], '', 'Whats your characters skin color?', true);
- _fields[_f++] = new Array('input', 'Character Race', ['size', 40, 'maxLength', 200], '', 'Whats your characters Class?', true);
- _fields[_f++] = new Array('select', 'Character Ailment', false, ['Good', 'Neutral', 'Evil'], 'Whats your characters Aliment?', true);
- _fields[_f++] = new Array('input', 'Character Weapon', ['size', 40, 'maxLength', 50], '', 'Whats your characters Weapon?', true);
- _fields[_f++] = new Array('textarea', 'Character Weapon Description', ['cols', 40, 'rows', 100], false, 'Whats the description of your characters weapon?', true);
- _fields[_f++] = new Array('textarea', 'Character Skillz', ['cols', 40, 'rows', 10], false, 'What's your characters skillz?', true);
- _fields[_f++] = new Array('input', 'Character Description', ['size', 40, 'maxLength', 50], false, 'Whats your character looks like. (Pics allowed)', true);
- _fields[_f++] = new Array('textarea', 'Character Bio', ['cols', 40, 'rows', 100, false, 'Whats the story behind your character?', true);
- _fields[_f++] = new Array('input', 'Password', ['size', 40, 'maxLength', 50], '', 'If you read the rules youd know what this means. (Most be filled in with the right password or your profile will not be accepted.', true);
- var _widths = ['100%', '20%', '40%', '40%'];
- var _posting_form = {
- errors: new Array(),
- init: function() {
- this.create_form();
- },
- create_form: function() {
- // Create new post layout
- var _holder = document.createElement('table');
- _holder.setAttribute('className', 'border');
- _holder.setAttribute('class', 'border');
- _holder.setAttribute('cellSpacing','1');
- _holder.setAttribute('cellPadding', '4');
- _holder.setAttribute('align', 'center');
- _holder.setAttribute('width', _widths[0]);
- _holder.setAttribute('id', 'post_form_holder');
- _holder.appendChild(document.createElement('tbody'));
- _holder.firstChild.appendChild( document.createElement('tr') ).appendChild( document.createElement('td') ).appendChild( document.createElement('font') );
- _holder.firstChild.lastChild.lastChild.className = 'title1';
- _holder.firstChild.lastChild.lastChild.colSpan = '3';
- _holder.firstChild.lastChild.lastChild.lastChild.size = '2';
- _holder.firstChild.lastChild.lastChild.lastChild.appendChild(document.createTextNode(_title));
- if(_description) {
- _holder.firstChild.appendChild( document.createElement('tr') ).appendChild( document.createElement('td') ).appendChild( document.createElement('font') );
- _holder.firstChild.lastChild.lastChild.setAttribute('className', 'window1');
- _holder.firstChild.lastChild.lastChild.setAttribute('class', 'window1');
- _holder.firstChild.lastChild.lastChild.setAttribute('colSpan', '3');
- _holder.firstChild.lastChild.lastChild.lastChild.setAttribute('size', '2');
- _holder.firstChild.lastChild.lastChild.lastChild.innerHTML = _description;
- }
- for(_f=0; _f<_fields.length; _f++) {
- switch(_fields[_f][0]) {
- case 'textarea' :
- var _tmp = document.createElement('textarea');
- break;
- case 'select' :
- var _tmp = document.createElement('select');
- for(_o=0; _o<_fields[_f][3].length; _o++) {
- _tmp.options[_o] = new Option(_fields[_f][3][_o], _fields[_f][3][_o]);
- }
- break;
- default :
- var _tmp = document.createElement('input');
- _tmp.type = 'text';
- if("undefined" != typeof _fields[_f][3] && _fields[_f][3] != "")
- _tmp.setAttribute('value', _fields[_f][3]);
- break;
- }
- _tmp.setAttribute('id', _f);
- if("undefined" != typeof _fields[_f][2] && _fields[_f][2].length > 0) {
- for(_a=0; _a<_fields[_f][2].length; _a++) {
- _tmp.setAttribute(_fields[_f][2][_a++], _fields[_f][2][_a]);
- }
- }
- var _class = 'window' + ((_f % 2 == 0)? '2' : '1');
- var _row = document.createElement('tr');
- _row.appendChild(document.createElement('td'));
- _row.lastChild.setAttribute('class', _class);
- _row.lastChild.setAttribute('className', _class);
- _row.lastChild.setAttribute('vAlign', 'top');
- _row.lastChild.setAttribute('width', _widths[1]);
- _row.lastChild.appendChild(document.createElement('font'));
- _row.lastChild.lastChild.setAttribute('size', '2');
- _row.lastChild.lastChild.style.fontWeight = 'bold';
- _row.lastChild.lastChild.appendChild(document.createTextNode(_fields[_f][1] + ':'));
- _row.appendChild(document.createElement('td'));
- _row.lastChild.setAttribute('class', _class);
- _row.lastChild.setAttribute('className', _class);
- _row.lastChild.setAttribute('width', _widths[2]);
- _row.lastChild.appendChild(document.createElement('font'));
- _row.lastChild.lastChild.setAttribute('size', '2');
- _row.lastChild.lastChild.appendChild(_tmp);
- _row.appendChild(document.createElement('td'));
- _row.lastChild.setAttribute('class', _class);
- _row.lastChild.setAttribute('className', _class);
- _row.lastChild.setAttribute('vAlign', 'top');
- _row.lastChild.setAttribute('width', _widths[3]);
- _row.lastChild.appendChild(document.createElement('font'));
- _row.lastChild.lastChild.size = '1';
- _row.lastChild.lastChild.appendChild(document.createTextNode(_fields[_f][4]));
- _holder.firstChild.appendChild(_row);
- }
- var _submit = document.createElement('tr');
- _submit.appendChild(document.createElement('td'));
- _submit.lastChild.setAttribute('class', 'window' + (((_f+1) % 2 == 0)? '1' : '2'));
- _submit.lastChild.setAttribute('className', 'window' + (((_f+1) % 2 == 0)? '1' : '2'));
- _submit.lastChild.setAttribute('align', 'center');
- _submit.lastChild.setAttribute('colSpan', 3);
- var _button = document.createElement('input');
- _button.setAttribute('type', 'button');
- _button.setAttribute('value', 'Post Message');
- _button.onclick = function() { _posting_form.post_it(); };
- _submit.lastChild.appendChild(_button);
- _holder.firstChild.appendChild(_submit);
- document.post_form.style.display = 'none';
- document.post_form.parentNode.insertBefore(_holder, document.post_form);
- },
- post_it: function() {
- // create message and attempt to post it
- this.errors = new Array();
- document.post_form.message.value = document.post_form.subject.value = '';
- var _sub = document.getElementById('0').value;
- _fields[0][5] = true;
- document.post_form.subject.value = _sub;
- for(_f=0; _f<_fields.length; _f++) {
- if(document.getElementById(_f)) {
- _value = document.getElementById(_f).value;
- if(!_value || _value.match(/^s*$/)) {
- if(_f > 0 && _fields[_f][5])
- this.show_error('You have left the ' + _fields[_f][1] + ' option empty. This is a required field and as such must contain a value.');
- else
- _value = '[i]None[/i]';
- }
- document.post_form.message.value += '[b]' + _fields[_f][1] + ':[/b] ' + _value + 'nn';
- }
- }
- if(this.errors.length == 0)
- document.post_form.post.click();
- else
- this.show_error();
- },
- show_error: function() {
- if("undefined" != typeof arguments[0] && arguments[0]) {
- this.errors.push(arguments[0]);
- } else {
- // Show Errors
- if(document.getElementById('status_holder')) {
- document.getElementById('status_holder_title').innerHTML = "An Error Has Occured";
- document.getElementById('status_holder_message').innerHTML = this.errors.join("<br />");
- document.getElementById('status_holder').style.display = 'block';
- }
- }
- }
- }
- if(document.post_form && location.href.match(/action/post/?$/) && vf_username != 'Guest') {
- _posting_form.init();
- }
- //-->
- </script>
What happens when you use it?![]()
nothing at all..it comes up as a normal posting form
Line 28: _fields[_f++] = new Array('textarea', 'Character Skillz', ['cols', 40, 'rows', 10], false, 'What's your characters skillz?', true);
You cannot have apostrophes in your question.![]()
Replace it with this:
_fields[_f++] = new Array('textarea', 'Character Skillz', ['cols', 40, 'rows', 10], false, 'What\'s your characters skillz?', true);
changed it and it still wont work also i edited the code above because i added this to it
Code:
- _fields[_f++] = new Array('input', 'Password', ['size', 40, 'maxLength', 50], '', 'If you read the rules youd know what this means. (Most be filled in with the right password or your profile will not be accepted.', true);
Can we get a link to your board, please?
http://dog1992.proboards20.com/
the posting template is under Character Profiles
I don't see Ross' code; I see California's.![]()
...
oops i sent you the wrong board... i sent your the proboards version...
http://inuyashasworld.virtualforums.co.uk/
bump..still getting the error, but not on the inuyasha site anymore, but on my fma site..
http://fmaadvanced.virtualforums.co.uk/
I Should've realized what the error was from the start.![]()
Here you go:
Code:
- <script type="text/javascript">
- <!--
- /* Predefined Posting Template/Form
- Created by Ross of vForums
- http://virtualforums.co.uk
- Please do not repost outside of
- vForums support without permission */
- var _title = 'Character Profile';
- var _description = 'Fill this out and post it to make your characters profile.';
- var _fields = new Array(); var _f = 0;
- _fields[_f++] = new Array('input', 'Character Full Name', ['size', 40, 'maxLength', 50], '', 'Your characters full name, first and last.', true);
- _fields[_f++] = new Array('input', 'Character NickName', ['size', 40, 'maxLength', 50], '', 'Character Nickname (If Doesnt Got One Just Put * )', true);
- _fields[_f++] = new Array('input', 'Character Age', ['size', 40, 'maxLength', 50], '', 'Put Your characters age here.', true);
- _fields[_f++] = new Array('input', 'Character Height', ['size', 40, 'maxLength', 50], '', 'Whats the height of your character?', true);
- _fields[_f++] = new Array('select', 'Character Gender', false, ['Male', 'Female'], 'Whats your characters Gender?', true);
- _fields[_f++] = new Array('select', 'Character Time', false, ['Japan', 'Feudal Japan'], 'What time is your character from? *Keep in mind that this sets where you can RP*', true);
- _fields[_f++] = new Array('input', 'Character Eye Color', ['size', 40, 'maxLength', 50], '', 'Whats your characters eye color?', true);
- _fields[_f++] = new Array('input', 'Character Hair Color', ['size', 40, 'maxLength', 50], '', 'Whats your characters hair color?', true);
- _fields[_f++] = new Array('input', 'Character Skin Color', ['size', 40, 'maxLength', 50], '', 'Whats your characters skin color?', true);
- _fields[_f++] = new Array('input', 'Character Race', ['size', 40, 'maxLength', 200], '', 'Whats your characters Class?', true);
- _fields[_f++] = new Array('select', 'Character Ailment', false, ['Good', 'Neutral', 'Evil'], 'Whats your characters Aliment?', true);
- _fields[_f++] = new Array('input', 'Character Weapon', ['size', 40, 'maxLength', 50], '', 'Whats your characters Weapon?', true);
- _fields[_f++] = new Array('textarea', 'Character Weapon Description', ['cols', 40, 'rows', 100], false, 'Whats the description of your characters weapon?', true);
- _fields[_f++] = new Array('textarea', 'Character Skillz', ['cols', 40, 'rows', 10], false, 'Whats your characters skillz?', true);
- _fields[_f++] = new Array('input', 'Character Description', ['size', 40, 'maxLength', 50], false, 'Whats your character looks like. (Pics allowed)', true);
- _fields[_f++] = new Array('textarea', 'Character Bio', ['cols', 40, 'rows', 100], false, 'Whats the story behind your character?', true);
- _fields[_f++] = new Array('input', 'Password', ['size', 40, 'maxLength', 50], '', 'If you read the rules youd know what this means. (Most be filled in with the right password or your profile will not be accepted.', true);
- var _widths = ['100%', '20%', '40%', '40%'];
- var _posting_form = {
- errors: new Array(),
- init: function() {
- this.create_form();
- },
- create_form: function() {
- // Create new post layout
- var _holder = document.createElement('table');
- _holder.setAttribute('className', 'border');
- _holder.setAttribute('class', 'border');
- _holder.setAttribute('cellSpacing','1');
- _holder.setAttribute('cellPadding', '4');
- _holder.setAttribute('align', 'center');
- _holder.setAttribute('width', _widths[0]);
- _holder.setAttribute('id', 'post_form_holder');
- _holder.appendChild(document.createElement('tbody'));
- _holder.firstChild.appendChild( document.createElement('tr') ).appendChild( document.createElement('td') ).appendChild( document.createElement('font') );
- _holder.firstChild.lastChild.lastChild.className = 'title1';
- _holder.firstChild.lastChild.lastChild.colSpan = '3';
- _holder.firstChild.lastChild.lastChild.lastChild.size = '2';
- _holder.firstChild.lastChild.lastChild.lastChild.appendChild(document.createTextNode(_title));
- if(_description) {
- _holder.firstChild.appendChild( document.createElement('tr') ).appendChild( document.createElement('td') ).appendChild( document.createElement('font') );
- _holder.firstChild.lastChild.lastChild.setAttribute('className', 'window1');
- _holder.firstChild.lastChild.lastChild.setAttribute('class', 'window1');
- _holder.firstChild.lastChild.lastChild.setAttribute('colSpan', '3');
- _holder.firstChild.lastChild.lastChild.lastChild.setAttribute('size', '2');
- _holder.firstChild.lastChild.lastChild.lastChild.innerHTML = _description;
- }
- for(_f=0; _f<_fields.length; _f++) {
- switch(_fields[_f][0]) {
- case 'textarea' :
- var _tmp = document.createElement('textarea');
- break;
- case 'select' :
- var _tmp = document.createElement('select');
- for(_o=0; _o<_fields[_f][3].length; _o++) {
- _tmp.options[_o] = new Option(_fields[_f][3][_o], _fields[_f][3][_o]);
- }
- break;
- default :
- var _tmp = document.createElement('input');
- _tmp.type = 'text';
- if("undefined" != typeof _fields[_f][3] && _fields[_f][3] != "")
- _tmp.setAttribute('value', _fields[_f][3]);
- break;
- }
- _tmp.setAttribute('id', _f);
- if("undefined" != typeof _fields[_f][2] && _fields[_f][2].length > 0) {
- for(_a=0; _a<_fields[_f][2].length; _a++) {
- _tmp.setAttribute(_fields[_f][2][_a++], _fields[_f][2][_a]);
- }
- }
- var _class = 'window' + ((_f % 2 == 0)? '2' : '1');
- var _row = document.createElement('tr');
- _row.appendChild(document.createElement('td'));
- _row.lastChild.setAttribute('class', _class);
- _row.lastChild.setAttribute('className', _class);
- _row.lastChild.setAttribute('vAlign', 'top');
- _row.lastChild.setAttribute('width', _widths[1]);
- _row.lastChild.appendChild(document.createElement('font'));
- _row.lastChild.lastChild.setAttribute('size', '2');
- _row.lastChild.lastChild.style.fontWeight = 'bold';
- _row.lastChild.lastChild.appendChild(document.createTextNode(_fields[_f][1] + ':'));
- _row.appendChild(document.createElement('td'));
- _row.lastChild.setAttribute('class', _class);
- _row.lastChild.setAttribute('className', _class);
- _row.lastChild.setAttribute('width', _widths[2]);
- _row.lastChild.appendChild(document.createElement('font'));
- _row.lastChild.lastChild.setAttribute('size', '2');
- _row.lastChild.lastChild.appendChild(_tmp);
- _row.appendChild(document.createElement('td'));
- _row.lastChild.setAttribute('class', _class);
- _row.lastChild.setAttribute('className', _class);
- _row.lastChild.setAttribute('vAlign', 'top');
- _row.lastChild.setAttribute('width', _widths[3]);
- _row.lastChild.appendChild(document.createElement('font'));
- _row.lastChild.lastChild.size = '1';
- _row.lastChild.lastChild.appendChild(document.createTextNode(_fields[_f][4]));
- _holder.firstChild.appendChild(_row);
- }
- var _submit = document.createElement('tr');
- _submit.appendChild(document.createElement('td'));
- _submit.lastChild.setAttribute('class', 'window' + (((_f+1) % 2 == 0)? '1' : '2'));
- _submit.lastChild.setAttribute('className', 'window' + (((_f+1) % 2 == 0)? '1' : '2'));
- _submit.lastChild.setAttribute('align', 'center');
- _submit.lastChild.setAttribute('colSpan', 3);
- var _button = document.createElement('input');
- _button.setAttribute('type', 'button');
- _button.setAttribute('value', 'Post Message');
- _button.onclick = function() { _posting_form.post_it(); };
- _submit.lastChild.appendChild(_button);
- _holder.firstChild.appendChild(_submit);
- document.post_form.style.display = 'none';
- document.post_form.parentNode.insertBefore(_holder, document.post_form);
- },
- post_it: function() {
- // create message and attempt to post it
- this.errors = new Array();
- document.post_form.message.value = document.post_form.subject.value = '';
- var _sub = document.getElementById('0').value;
- _fields[0][5] = true;
- document.post_form.subject.value = _sub;
- for(_f=0; _f<_fields.length; _f++) {
- if(document.getElementById(_f)) {
- _value = document.getElementById(_f).value;
- if(!_value || _value.match(/^s*$/)) {
- if(_f > 0 && _fields[_f][5])
- this.show_error('You have left the ' + _fields[_f][1] + ' option empty. This is a required field and as such must contain a value.');
- else
- _value = '[i]None[/i]';
- }
- document.post_form.message.value += '[b]' + _fields[_f][1] + ':[/b] ' + _value + 'nn';
- }
- }
- if(this.errors.length == 0)
- document.post_form.post.click();
- else
- this.show_error();
- },
- show_error: function() {
- if("undefined" != typeof arguments[0] && arguments[0]) {
- this.errors.push(arguments[0]);
- } else {
- // Show Errors
- if(document.getElementById('status_holder')) {
- document.getElementById('status_holder_title').innerHTML = "An Error Has Occured";
- document.getElementById('status_holder_message').innerHTML = this.errors.join("<br />");
- document.getElementById('status_holder').style.display = 'block';
- }
- }
- }
- }
- if(document.post_form && location.href.match(/action\/post\/?$/) && vf_username != 'Guest') {
- _posting_form.init();
- }
- //-->
- </script>