Re: Form executes differently in IE than in FireFox?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Le mer 03/11/2004 à 09:55, Murray @ PlanetThoughtful a écrit :
> Hi All,

Hi, and sympathy about the 12 lines signature :-)
However, only the test part of your script (the
if(isset($_POST['recid']))... ) was needed.

> I'm a little confused by a problem I'm experiencing with a form that is
> being processed differently between IE and FireFox.

> For some reason, when a new record on my form is submitted to the code
> below, it gets processed as though it were an edit operation when executed
> via Internet Explorer, but executes as an insert when via FireFox. 

> On the form, 'recid' is a hidden field that is populated from the query
> string. If recid has a value, the assumption is made that the operation is
> an edit. If recid has no value, then the assumption is made that the
> operation is an insert.

What might occur is that IE fills the value with a blank. Which is
probably what you put in your form anyway.

So I would say there are two ways to solve the problem.
1) change your 
  isset($_POST['recid']) 
with a 
  !empty($_POST['recid'])
which is equivalent to 
  if(isset($_POST['recid']) && ($_POST['recid'] != ""))

2) do not output any <input type="hidden" name="recid"> if the value
isn't defined. I bet you probably have something like this at the moment
(when there is no value):
  <input type="hidden" name="recid" value="">
Which would explain why IE sets it as defined but empty.

If this doesn't work, I probably can't help you.

Yannick

PS: you might be interested in the web developer extension for Firefox
and it's "Display Form Details" function.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux