/    Sign up×
Community /Pin to ProfileBookmark

I’m Totally Stumped —- What"s The Deal Here????????

Guys:

I’ve just wasted over an hour trying to solve a mystery of why in one of my forms when user hits Submit button the name of that button does not get sent with the rest of the form……… I’m still stumped over it.

Here’s the simplest HTML + PHP combo that is still not working:

[code=html]<html>

<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=windows-1252″>
<title>New Page 1</title>
</head>

<body>

<form method=”POST” action=”test.php”>
<p><input type=”text” name=”T1″ size=”20″><input type=”submit” value=”Add New User” name=”naubadd” title=”Click here to add new user”></p>
</form>

</body>

</html>[/code]

And test.php

[code=php]<?php
print_r($_POST);
print “<br>BUtton name value = “.$_POST[‘naubadd’];
?>[/code]

If you go to the link above and click “Add New User” button PHP script will show that naubadd => Add New User, now how the hell when someone hits Enter instead of clicking button the naubadd is GONE????????????????????????????? AM I TOTALLY LOSING IT OR THE SERVER IS SCREWED UP???? I’m sorry for my language, I’m just not used to wasting so much time over such idiosy.

PS. I’m using IE 6 that comes with XP Pro

to post a comment
HTML

3 Comments(s)

Copy linkTweet thisAlerts:
@Wiz_CreationsJul 26.2006 — Don't you need it to do something with T1? That is where the user enters the new username, but the php doesn't do anything with it. Sorry, I don't really know php, and the problem seems to be more php than html, so I would ask in the php forums.
Copy linkTweet thisAlerts:
@ray326Jul 26.2006 — The button is only sent when it is clicked. If you're routing with that value then put it in a hidden field in the form and don't rely on the button.
Copy linkTweet thisAlerts:
@dc2000authorJul 27.2006 — The button is only sent when it is clicked[/QUOTE]This is totally not true -- do you mean that if someone hits enter nothing is sent? THat's how I submit all my forms....

I made some research and here's what I found. If someone can explain this for me I'd appreciate that.... Aparently something was done to IE that I was not aware of. You know what was the most confusing for me -- all of my pages that rely on names of submit buttons work except one. I looked all through a nonworking page and there's absolutely no difference between it and good ones (well, of course, they have different HTML tags). It totally beats me..........

Here are some links:

http://www.faqts.com/knowledge_base/view.phtml/aid/3971

http://www.quirksmode.org/bugreports/archives/2006/07/Namevalue_pairs_arent_submitted_for_image_submit_b.html

http://muffinresearch.co.uk/archives/2005/12/08/fun-with-multiple-submit-buttons/
×

Success!

Help @dc2000 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.7,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...