Form inside a hidden div has no values on post
Posted
by Mick
on Stack Overflow
See other posts from Stack Overflow
or by Mick
Published on 2010-03-28T16:03:02Z
Indexed on
2010/03/28
16:13 UTC
Read the original article
Hit count: 188
I have a html form that posts to a new page on submit. If required a user can click a button to make a small table visible in a div box. this adds more text input fields to my form.
The problem is, regardless of the div box being hidden or visible none of the additional fields data is sent when the form is posted .
the div box code
function quotevisi()
{
document.getElementById("quote").style.visibility = "visible";
tdat = "" ;
tdat += "<h2 align='center' >Client Quotation </h2>" ;
tdat += "<table align='center'cellpadding='1' width='690px'><tr>"
tdat += "<td ></td><td>Additional 1</td>" ;
tdat += "<td ><label><textarea id='line1' cols='50' rows='1'>"
tdat += "</textarea></label></td></tr>"
tdat += "<td ></td><td >Additional 2 </td>" ;
tdat += "<td ><label><textarea id='line2' name='line2' cols='50' rows='1'>"
tdat += "</textarea></label></td></tr>"
tdat += "<td ></td><td >Additional 3 </td>" ;
tdat += "<td ><label><textarea id='line3' name='line3' cols='50' rows='1'>"
tdat += "</textarea></label></td></tr>"
tdat += "<td ></td><td >Special Instructions</td>" ;
tdat += "<td ><label><textarea id='special' name='special' cols='50' rows='1'>"
tdat += "</textarea></label></td></tr>"
tdat += "<td ></td><td ></td> <td>" ;
tdat += "<input type='button' value='View Quote' onclick='view_quote()' /> "
tdat += "<input type='button' value='Close' onclick='closequote()' /> "
tdat += "<td ></td> " ;
tdat += "</table> "
// display in the quote div (style sheet)
document.getElementById('quote').innerHTML= tdat
}
The form is a bit big to but the button for the hidden field is this
<td ><input class="buttn" type="button" value="Extra Quote details " onclick="quotevisi();" /> </td>
I would of thought that all this information would go with the form on post . But it doesent. Oh finally the div box code is placed after this line
<form style='background-color:ccc' id='form1' name='form1' method='post' action='process.php' >
Any help or thoughts would be much appreciated
thanks Mick
© Stack Overflow or respective owner