[ciapug] Form submission

Dave J. Hala Jr. ciapug@cialug.org
09 Sep 2004 15:50:28 -0500


On Thu, 2004-09-09 at 15:42, David Champion wrote:
> Don't you mean - $_POST["submit"] ? :p

<evil grin>

> 
> -dc
> 
> Chris Hettinger wrote:
> 
> > My script is similar I check "if (submit)"... thanks Tim.
> > 
> > -ch
> > 
> > Tim Perdue wrote:
> > 
> >> Jerry Weida wrote:
> >>
> >>> This generally occurs when the submit button is not of the type
> >>> submit.  You can either change that to a submit type or your can write
> >>> some javascript.
> >>> can't remember how to get the keycode into the fuction, but I'm sure
> >>> you can find that out somewhere online pretty easy, or maybe someone
> >>> here on the list would know.
> >>> some pseudo-code
> >>>
> >>> <input type="button" onChange="javascript:submitform()" />
> >>>
> >>> function submitform() {
> >>>   if btn=chr(13)   # see if we hit the enter key
> >>>     document.forms[0].submit()
> >>> }
> >>
> >>
> >>
> >> I've had this happen when I do use the type="submit", and on the 
> >> receiving end, my php is looking for "if ($submit) {"
> >>
> >> Since submit was never pressed, the if statement doesn't work out to 
> >> true.
> >>
> >> So you can get around it by having an <input type="hidden" name="foo" 
> >> value="1"> and then on the receiving end you do "if ($foo) "
> >>
> >> And it works out to true whether they hit submit button or not.
> >>
> >> Tim
> 
> 
> _______________________________________________
> ciapug mailing list
> ciapug@cialug.org
> http://cialug.org/mailman/listinfo/ciapug
-- 


OSIS
Dave J. Hala Jr.
641.485.1606