Jump to content

form not sending input values


real_illusions

Recommended Posts

Hi all,I have a form which doesn't like sending the values of the input fields.I cant really show you the page with the HTML code as its a private project I'm working on.However, the PHP script I've used several times before, and although I've modified it to suit the form values this time around...nothing else has changed.Here is an example of one input value:<label for="firstname">First Name:<input type="text" id="firstname" value="" /></label>The form is <form method="post" action="test.php">and in test.php is simply var_dump( $_POST ); to find out whats been sent.Basically, the submit input value is the only one being sent. Even if I set an input with a value hard coded (such as the example above), it still doesn't send.Are there any possible reasons for this?

Link to comment
Share on other sites

It was all valid HTML when I did the input inside a label...although if the name attribute is required, but still valid HTML? Hmm..will have to see about that. Are the W3 saying that the input is valid without a name attribute, but yet its required for processing the form...interesting...

Link to comment
Share on other sites

There is no requirement for a form to be sent at all, and no requirement for all form input data to be sent. You might, for example, want to use several form elements to calculate a single value that is sent. These are just a few reasons why you might not want to bother with a name attribute.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...