simeonC Posted July 5, 2013 Share Posted July 5, 2013 Issue I have a form which is submitted and entered to a database like all forms. The problem begins when I started using form elements outside of the form tags. as such <form action="shopfunction.php?repair_id=<?php echo urlencode($_SESSION['repair_id']) ?>" id="customer_info" method="post" name="customer_info"> <td align="center"><input type="text" name="tag" autocomplete="" value="<?php echo $customer_info['tag']?>"></td> <td align="center"><input type="text" name="vin" autocomplete="" value="<?php echo $customer_info['vin']?>"></td> <td align="center"><input type="text" name="miles_in" autocomplete="" value="<?php echo $customer_info['miles_in']?>"></td> <td align="center"><input type="text" name="miles_out" autocomplete="" value="<?php echo $customer_info['miles_out']?>"></td> </form> --------------------VVVVVVV-------------------These are outside the form tag----------However have the form id attribute to be recognised------------VVV <td align="left">Sublet/Others</td> <td align="left"><input type="text" name="others" size="10" form="customer_info" value="<?php echo $display_other;?>"></td> </tr> <tr> <td align="left">***Shop Supplies</td> <td align="left"><input type="text" name="supplies" size="10" form="customer_info" value="<?php echo $display_supply ?>"></td> </tr> <tr> <td align="left">***Fees</td> <td align="left"><input type="text" name="fees" size="10" form="customer_info" value="<?php echo $display_fees; ?>"></td> I have no idea why may be you guys can help me. Have my php script recognise these elements as form elements Quote Link to comment https://forums.phpfreaks.com/topic/279902-issue-form-elements-outside-of-form-are-not-being-recognised/ Share on other sites More sharing options...
Psycho Posted July 5, 2013 Share Posted July 5, 2013 (edited) Probably because that was the whole point of having opening and closing form tags. The elements between those tags represent what is in the form. The form attribute is not supported in all browsers. So, if you want to be backward compatible you will need to put everything in the form tags EDIT: http://www.w3schools.com/tags/att_input_form.asp The form attribute is supported in all major browsers, except Internet Explorer. Edited July 5, 2013 by Psycho Quote Link to comment https://forums.phpfreaks.com/topic/279902-issue-form-elements-outside-of-form-are-not-being-recognised/#findComment-1439574 Share on other sites More sharing options...
simeonC Posted July 5, 2013 Author Share Posted July 5, 2013 Im using safari and firefox. Should I still just wrap them in the form tag because it will break my code. Quote Link to comment https://forums.phpfreaks.com/topic/279902-issue-form-elements-outside-of-form-are-not-being-recognised/#findComment-1439576 Share on other sites More sharing options...
Solution Psycho Posted July 6, 2013 Solution Share Posted July 6, 2013 Im using safari and firefox. Should I still just wrap them in the form tag because it will break my code. Depending on which version of those browsers you have, I suppose it should work. Maybe you have some other problem. But, you can put those other fields inside your form and have them displayed elsewhere on the page. Just use CSS to position them accordingly. Quote Link to comment https://forums.phpfreaks.com/topic/279902-issue-form-elements-outside-of-form-are-not-being-recognised/#findComment-1439590 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.