NYCPHP Meetup

NYPHP.org

[nycphp-talk] Trapping JS errors in function called onSubmit

David Mintz david at davidmintz.org
Thu May 8 12:29:23 EDT 2008


Amen to that -- Firebug is an immense help. Indispensable, even, if you are
doing Ajax and need to inspect the stuff coming back at you. Too bad FF 2.x
is such a prolifigate hog and waster of memory -- it's really killing me
here on Fedora 7.

On Tue, May 6, 2008 at 6:49 PM, Tim Lieberman <tim_lists at o2group.com> wrote:

> Also: Firebug is your friend.  Just set a breakpoint on the first line of
> your function, and step through.
>
> -Tim
>
>
> On May 6, 2008, at 4:25 PM, Kristina Anderson wrote:
>
>  thanks!!  will do.
>>
>>
>>
>>  On Tue, May 6, 2008 at 5:59 PM, Kristina Anderson
>>> <ka at kacomputerconsulting.com> wrote:
>>>
>>>>
>>>>  Hi everyone --
>>>>
>>>>  I'm trying to build out a validation routine for my input forms and
>>>>  found something that I like/find easy to extend.  I added it as an
>>>>  external script to my test page.  I tested to make sure all the
>>>>  subfunctions were being called by inserting alert boxes and they
>>>>
>>> are
>>
>>>  being called.  Unfortunately, the routine is not picking up my
>>>>  empty/non valid fields and instead appears to be just
>>>>
>>> returning "true"
>>
>>>  and submitting the form.
>>>>
>>>>
>>> My guess is that your javascript has errors which prevents the submit
>>> handler from returning false.  This makes it really hard for
>>> debugging...
>>>
>>> Try the following when developing:
>>> <form onsubmit="validate(this);return false;">
>>> instead of
>>> <form onsubmit="return validate(this)">
>>>
>>> This way when "validate" errors out, the submission will still be
>>> trapped and you can see the errors in the console.
>>>
>>> HTH,
>>>
>>> -john c.
>>> _______________________________________________
>>> New York PHP Community Talk Mailing List
>>> http://lists.nyphp.org/mailman/listinfo/talk
>>>
>>> NYPHPCon 2006 Presentations Online
>>> http://www.nyphpcon.com
>>>
>>> Show Your Participation in New York PHP
>>> http://www.nyphp.org/show_participation.php
>>>
>>>
>>>
>> _______________________________________________
>> New York PHP Community Talk Mailing List
>> http://lists.nyphp.org/mailman/listinfo/talk
>>
>> NYPHPCon 2006 Presentations Online
>> http://www.nyphpcon.com
>>
>> Show Your Participation in New York PHP
>> http://www.nyphp.org/show_participation.php
>>
>
> _______________________________________________
> New York PHP Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
>
> NYPHPCon 2006 Presentations Online
> http://www.nyphpcon.com
>
> Show Your Participation in New York PHP
> http://www.nyphp.org/show_participation.php
>



-- 
David Mintz
http://davidmintz.org/

The subtle source is clear and bright
The tributary streams flow through the darkness
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20080508/d033eae7/attachment.html>


More information about the talk mailing list