I end up replying to myself quite often -- apologies for that. :-) A
temporary hack contradicts my original intentions, which is modifying
the source of iUI.
I've gone ahead and modified the submitForm() function in order to
allow my own client-side validation to take place. I did something to
the effect of:
function submitForm(form)
{
var retval = _validate(); // custom validation funct. -sf
retval == true ? iui.showPageByHref(form.action || "POST",
encodeForm(form), form.method) : null; // also modified by me.
}
It works for now. My only other concern is that after my form
successfully submits, my back button in the top left of the toolbar
inherits the ID of my form name. This is a bit misleading because it's
supposed to go back to the Home screen. Clicking on that button does
not take you to the form itself.
Any idea why that behavior takes place?
/sf
On 1/30/08, Steve Finkelstein <[EMAIL PROTECTED]> wrote:
> Hey peeps,
>
> Is there a non-obtrusive way to do client-side form validation with
> JavaScript when utilizing iUI? I'd like to do this without ultimately
> hacking iui.js and leaving that as pristine as possible. Adding event
> handlers such as onsubmit to my form, even if I return false from the
> handler, will continue to submit the form regardless.
>
> Has anyone gone about an elegant way of handling such?
>
> /sf
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"iPhoneWebDev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/iphonewebdev?hl=en
-~----------~----~----~----~------~----~------~--~---