SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Feb 2008
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    validation + scriptaculous effects...?

    Hello

    I am trying to put effect in form, if there is any empty fields. I tried the below function but it doesn't work.

    PHP Code:
    function checkscript() {
     for (var 
    i=1;i<3;i++) {
     var 
    box document.login.elements[i];
         if (!
    box.value) {
           
    box.value box.value;
           new 
    Effect.Shake('content');
           return 
    false;
         }
     }
     return 
    true;

    <blockquote id="content"> <form ... onsubmit="checkscript()";> ... </form> </blockquote>
    Last edited by nologo; Feb 20, 2008 at 19:25.

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,810
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Do you have name="login" in the form tag?
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  3. #3
    SitePoint Member
    Join Date
    Feb 2008
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    Do you have name="login" in the form tag?
    yes

    its on/off sometime it works or it doesnt.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •