On Mon, Aug 06, 2001 at 12:31:38PM -0700, Mark Maggelet wrote:
> i can't tell if it's just a email formatting thing, but if there's a
> line break in the onsubmit string it might mess things up.
It no _might_ mess things up... It sure does! Good one.
But... another thing. You just might want to consider using braces.
They're not invented for nothing. When you call functions (like
return) you should use braces. Especialy when you start writing more
complex scripts, the not using any braces, is just the thing that
may because a lot of trouble.
Weird thing btw, that the JavaScript console doesn't show any errors
when there's a newline between return and verifyInput. I mean...
it's a good example of a syntax error. But that stupid console
doesn't show any damn thing.
Btw... not that it matter anyway, but:
onsubmit="return <\n> verifyInput();"
doesn't do the right thing (as we've all seen), but:
onsubmit="return( <\n> verifyInput());"
does. (...)
> well, if it makes it this far, $input will be set, but the value will
> be "". try empty() instead of !isset()
Well, Mark... almost! You shouldn't use empty() _instead_ of
isset(). You should use 'm together:
if (isset ($input) && !empty($input)) {
print ("Okay... form is completed!");
} else {
print ("No way... can't do!");
}
Because, when you check using empty($input) there's still the
possibility that $input isn't defined at all. And then some horrible
error still arises in your logfile.
Note btw that you shouldn't change the order of isset() and empty()
in the above example.
--
* R&zE:
-- »»»»»»»»»»»»»»»»»»»»»»»»
-- Renze Munnik
-- DataLink BV
--
-- E: [EMAIL PROTECTED]
-- W: +31 23 5326162
-- F: +31 23 5322144
-- M: +31 6 21811143
-- H: +31 23 5516190
--
-- Stationsplein 82
-- 2011 LM HAARLEM
--
-- http://www.datalink.nl
-- ««««««««««««««««««««««««
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]