Jump to content


Photo

Submit not submitting


  • Please log in to reply
6 replies to this topic

#1 cyprus

cyprus
  • Members
  • PipPipPip
  • Advanced Member
  • 68 posts

Posted 22 September 2006 - 02:43 PM

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">

#2 akitchin

akitchin
  • Staff Alumni
  • Advanced Member
  • 2,516 posts
  • LocationCalgary, AB, Canada

Posted 22 September 2006 - 02:47 PM

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.

#3 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 22 September 2006 - 02:51 PM

show the page processing the form.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#4 Daniel0

Daniel0
  • Staff Alumni
  • Advanced Member
  • 11,956 posts

Posted 22 September 2006 - 02:59 PM

Or you could change it to:
if(count($_POST) > 0)

That will work with whatever you call your submit button.

#5 cyprus

cyprus
  • Members
  • PipPipPip
  • Advanced Member
  • 68 posts

Posted 22 September 2006 - 03:27 PM

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

#6 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,016 posts

Posted 22 September 2006 - 06:54 PM

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.
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#7 cyprus

cyprus
  • Members
  • PipPipPip
  • Advanced Member
  • 68 posts

Posted 22 September 2006 - 10:23 PM

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users