Need some help with the "Form Tableless Layout" Add-on.

Permalink
I building a site for a client that has a quick contact form that is native on all the pages other then the contact page.

I have copied and edited the template file tableless_layout.php and changed the name to tableless_layout2.php.

I have commented out the html and the php on lines 113 thru. 118 in Dreamweaver. I then added on lines 119 thru. 136 the following javascript code.

<script type="text/javascript">
var q1 = document.getElementById('Question1');
if (q1 != null) {
q1.setAttribute('value', 'Name');
}
var q2 = document.getElementById('Question2');
if (q2 != null) {
q2.setAttribute('value', 'Title');
}
var q3 = document.getElementById('Question3');
if (q3 != null) { q3.setAttribute('value', 'Email');
}
var q4 = document.getElementById('Question4');
if (q4 != null) {
q4.setAttribute('value', 'Phone');
}
</script>

The problem is the forth statement is not outputting the value that I want.

Here is the link to the site as it is. I have not installed the new theme even though it is ready because I want everything to work before I show the client.

http://www.workingminddesigns.com/client-websites/anewwayofthinking...

SoulDesigns
 
TheRealSean replied on at Permalink Reply
TheRealSean
Well the name is Question4 but I can not see an ID with "Question4" try adding in id="Question<?php echo $questionIDvar?>"

though I am curious to see if the others worked? but I thought getElementById works from the ID and not the name? Try getElementsByName(name)
jordanlev replied on at Permalink Reply
jordanlev
The html for the form on the page you linked to does not look like it was generated from the Form Tableless Layout template. Can you post the modified template you're using (tableless_layout2.php)?

It looks like you removed the part of the code that actually generates the question elements and replaced them with your own "static" form elements. If this is the case, then the form submission won't work because the form block code is looking for different names on the input elements (and these names are different for every block, so you can't "hard-code" them using Dreamweaver, for example).

-Jordan