jdkos
jdkos

Reputation: 7

Input form wont submit?

protected function pro_show_sendRequestForm(){
    echo("<SECTION id='page_content-small'>");
    echo("<ARTICLE>");
    echo("<table width='100%' cellspacing='5'>");
    echo("<tr><td><form method='post' action='main.php'></td></tr>");
    echo("<tr><td colspan ='2' align='center'><B><H2>Send a event form.</H2></B></td></tr>");
    echo("<tr><td align='left'><B>Name event:</B></td>");
    echo("<td align='left'><input name='sEventTitle' type='text' size='30' maxlength='50' required></td></tr>");   
    echo("<tr><td align='left'><B>Name organisation:</B></td>");          
    echo("<td align='left'><B>New: </B><input name='sNewOrganisationName' type='text' size='30' maxlength='50'></td></tr>");
    echo("<tr><td>&nbsp;</td><td align='left'><B>Or choose: </B>");
    $this->pro_OrganisationDropdown('sExcistingOrganisationRecordNumber'); 
    echo("</td><tr>");
    echo("<tr><td align='left'><B>E-mail address:</B></td><td align='left'>"); 
    echo("<input name='sEmailadress' type='text' size='30' maxlength='50' required></td></tr>");
    echo("<input type='hidden' name='sSubmitForm' value='SendIntakeForm'>");
    echo("<tr><td colspan='3' align='center'><input type='submit' value=' Sending '></td></tr>");
    echo("</form></table></ARTICLE></SECTION>");
}

Hi you all,
Today I created this form and it worked fine. Until I started with testing and then i discovered that a certain value in the input field 'sEventTitle' was the reason that the form wasn't processed. I checked and rechecked but the value for example 'Apple' was excepted and the value 'pineapple' wasn't.
So to discover why, I commented all other input fields out like this:

protected function pro_show_sendRequestForm(){
    echo("<SECTION id='page_content-small'>");
    echo("<ARTICLE>");
    echo("<table width='100%' cellspacing='5'>");
    echo("<tr><td><form method='post' action='main.php'></td></tr>");
    echo("<tr><td colspan ='2' align='center'><B><H2>Send a event form.</H2></B></td></tr>");
    echo("<tr><td align='left'><B>Name event:</B></td>");
    echo("<td align='left'><input name='sEventTitle' type='text' size='30' maxlength='50' required></td></tr>");   
    //echo("<tr><td align='left'><B>Name organisation:</B></td>");          
    //echo("<td align='left'><B>New: </B><input name='sNewOrganisationName' type='text' size='30' maxlength='50'></td></tr>");
    //echo("<tr><td>&nbsp;</td><td align='left'><B>Or choose: </B>");
    //$this->pro_OrganisationDropdown('sExcistingOrganisationRecordNumber'); 
    //echo("</td><tr>");
    //echo("<tr><td align='left'><B>E-mail address:</B></td><td align='left'>"); 
    //echo("<input name='sEmailadress' type='text' size='30' maxlength='50' required></td></tr>");
    echo("<input type='hidden' name='sSubmitForm' value='SendIntakeForm'>");
    echo("<tr><td colspan='3' align='center'><input type='submit' value=' Sending '></td></tr>");
    echo("</form></table></ARTICLE></SECTION>");
}

Now the entire form wont submit itself. This can not be true.
The basics are there: form and /form. A input name ='foo' type='text' and a submit button. Why is this form not submitted when the larger one is working? What is my mistake? Is there something I don't see? Any help is appriciated.

The first lines from main.php to see if the form is submitted are:

$oMainPage = new main();
echo($_POST['sEventTitle']);
echo($_POST['sSubmitForm']);

The code generated from the browser:

 <SECTION id='page_content-small'><ARTICLE><form method='post' action='main.php'>
 <table width='100%' cellspacing='5'><tr><td colspan ='2' align='center'><B>  
 <H2>Een aanmeldformulier versturen.</H2></B></td></tr><tr><td align='left'>  
 <B>Naam evenement:</B></td><td align='left'>  
 <input name='sEventTitle' type='text' size='30' maxlength='50' required></td></tr>  
 <input type='hidden' name='sSubmitForm' value='SendIntakeForm'><tr>  
 <td colspan='3' align='center'><input type='submit' value=' Versturen '></td></tr>  
 </table></form></ARTICLE></SECTION>

Upvotes: 0

Views: 102

Answers (1)

T McKeown
T McKeown

Reputation: 12857

take the form out of the <td>, wrap the <form> around that <table>

Upvotes: 0

Related Questions