Jump to content

Archived

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

cyprus

Submit not submitting

Recommended Posts

I have a submit button which will not submit a form if its name is not Submit? The code below shows it in a non working mode, if I replace X1 with the word Submit it works? Many thanks


<input type="submit" name="X1" value="Select All Data Required - Click to Submit">

Share this post


Link to post
Share on other sites
shouldn't depend on the name attribute, only the name.  it might be that your script is checking if $_POST['Submit'] is set before it'll do anything, in which case change the index to X1.

Share this post


Link to post
Share on other sites
Or you could change it to: [code]if(count($_POST) > 0)[/code]

That will work with whatever you call your submit button.

Share this post


Link to post
Share on other sites
Many thanks all. The form should just submit back to itself. At present there is no directing regarding $_POST values. Mystery?

Share this post


Link to post
Share on other sites
The default "action" for a form is to call itself. So if the form has action="", or action is not defined at all, then the $_POST will be sent to same script that the form is in.

Share this post


Link to post
Share on other sites
Thanks, problem solved. I did not think the page was being submitted as a dropdown list was not filling. Buried deep was an If statement surrounding a $_Post return referenced to submit button named submit. I discovered the page was getting submitted by Barands earlier teaching of printing out all Posted details, so thanks everyone its fixed.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.