Current location: Hot Scripts Forums » Programming Languages » PHP » little form problem


little form problem

Reply
  #1 (permalink)  
Old 08-08-07, 01:38 PM
jonnekke jonnekke is offline
Code Guru
 
Join Date: Oct 2005
Location: holland!
Posts: 706
Thanks: 0
Thanked 0 Times in 0 Posts
little form problem

hi there,

got a form wich i want to submit or clear by clicking an image... it's in code like this:

HTML Code:
<input type="image" name="submit" value="submitname" src="images/plaats.jpg" > <br><br><br>
  <input type="image" src="images/wis.jpg" name="reset">
in the following script there is this line:

PHP Code:

if(isset($_POST['submit'])){ 

somehow the "submit" isn't passed to the next script... anybody got an idea?..

_j
Reply With Quote
  #2 (permalink)  
Old 08-08-07, 01:47 PM
mab's Avatar
mab mab is offline
Community VIP
 
Join Date: Oct 2005
Location: Denver, Co. USA
Posts: 2,674
Thanks: 0
Thanked 0 Times in 0 Posts
http://www.php.net/manual/en/faq.htm...tml.form-image

Also, echo out your data to see what it actually contains -
PHP Code:

echo "<pre>";

print_r($_POST);
echo 
"</pre>"
__________________
Error checking, error reporting, and error recovery. If your code does not have these to get it to tell you why it is not working, what makes you think someone in a programming forum will be able to tell you why it is not working???
Reply With Quote
  #3 (permalink)  
Old 08-08-07, 05:32 PM
daveganley daveganley is offline
Newbie Coder
 
Join Date: Jun 2003
Location: London UK
Posts: 99
Thanks: 0
Thanked 0 Times in 0 Posts
I've encountered this problem before, it was IE on windows that was causing the problem as I think it was passing a X, Y post variable instead of the submit parameter. The work around was to add a hidden form field and listen for that.

In the form add a hidden field of 'action' with the value of 'add'

then in php use

PHP Code:

if(isset($_POST['action']) && $_POST['action'] == "add"){ 

hope that helps

Dave
Reply With Quote
  #4 (permalink)  
Old 08-09-07, 05:38 AM
infinitylimit's Avatar
infinitylimit infinitylimit is offline
Code Guru
 
Join Date: Jun 2004
Location: Oregon
Posts: 758
Thanks: 0
Thanked 0 Times in 0 Posts
This actually probably only happens to be a problem in firefox or IE. I've noticed that when you use type="image" it tends to mess things up. What I do is use css to fix the problem.

HTML Code:
input .submit{
      background-image:url(images/plaats.jpg);
}


<input class="submit" type="submit" value=" " name="submit">

This little bit of code will solve the problem for you. My recommendation is to not use type="image" back in the day it wasn't supported for a reason.
__________________
Hawk Enterprises -- Home to PHP games, open-source code, tutorials and free downloads
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
form in form problem dharprog JavaScript 3 11-25-06 10:01 AM
Form Display Problem neevrap02 Visual Basic 1 09-05-06 05:18 AM
Email form problem slimey PHP 1 03-08-06 02:46 AM
checkCheckboxGroup broken after form consolidation ski_woman JavaScript 0 01-12-05 11:00 AM
Form Submission, PHP Coding Problem kibby67 PHP 3 12-02-04 01:13 PM


All times are GMT -5. The time now is 06:08 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.