cyprus Posted September 22, 2006 Share Posted September 22, 2006 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"> Quote Link to comment https://forums.phpfreaks.com/topic/21668-submit-not-submitting/ Share on other sites More sharing options...
akitchin Posted September 22, 2006 Share Posted September 22, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/21668-submit-not-submitting/#findComment-96752 Share on other sites More sharing options...
Ninjakreborn Posted September 22, 2006 Share Posted September 22, 2006 show the page processing the form. Quote Link to comment https://forums.phpfreaks.com/topic/21668-submit-not-submitting/#findComment-96755 Share on other sites More sharing options...
Daniel0 Posted September 22, 2006 Share Posted September 22, 2006 Or you could change it to: [code]if(count($_POST) > 0)[/code]That will work with whatever you call your submit button. Quote Link to comment https://forums.phpfreaks.com/topic/21668-submit-not-submitting/#findComment-96761 Share on other sites More sharing options...
cyprus Posted September 22, 2006 Author Share Posted September 22, 2006 Many thanks all. The form should just submit back to itself. At present there is no directing regarding $_POST values. Mystery? Quote Link to comment https://forums.phpfreaks.com/topic/21668-submit-not-submitting/#findComment-96780 Share on other sites More sharing options...
Barand Posted September 22, 2006 Share Posted September 22, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/21668-submit-not-submitting/#findComment-96886 Share on other sites More sharing options...
cyprus Posted September 22, 2006 Author Share Posted September 22, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/21668-submit-not-submitting/#findComment-96999 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.