Loading...

iphonewebdev@googlegroups.com

[Prev] Thread [Next]  |  [Prev] Date [Next]

Re: Form Check Hamurabi Web Tech. Mon Oct 03 12:00:43 2011

@Garrett,
If I use submit button, then I can't check the form inputs using Javascript
to validate values.
Lets say for example I want to check wether the <input type="text"
name="username" id="username" /> is empty? currently I use PHP to validate
this but I wish I can do it in Javascript:
if( document.getElementById('username').value == '')
    alert('Please enter your username');
else
   form.submit();

Any alternative way to check using JS?

Cheers,
Oras

On Thu, Sep 29, 2011 at 6:00 PM, Garrett Smith <[EMAIL PROTECTED]>wrote:

> On 9/28/11, Giacomo Balli <[EMAIL PROTECTED]> wrote:
> > nothing fails if done correctly... ;)
> Top posting is a common source of communication failure.
>
> > I prefer ajax.
> It's Ajax.
> --
> Garrett
>
> --
> 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.
>
>


-- 
شركة حمورابي لتقنيات المعلومات المحدودة
www.hamuraabi.com

-- 
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.