Results 1 to 3 of 3

Thread: call second function after first

  1. #1
    Join Date
    Jun 2008
    Posts
    121
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default call second function after first

    hi all

    i have two functions

    Code:
    function Checkfiles(f){
    f = f.elements;
    if(/.*\.(gif)|(jpeg)|(jpg)$/.test(f['banner_image'].value.toLowerCase()))
    return true;
    alert('Please Upload Gif or Jpg Images.');
    f['banner_image'].focus();
    return false;
    };
    
    
    function start()
    {
     document.getElementById('worli').style.visibility = 'visible';
    }
    calling these functions
    Code:
    <form action="" method="post" enctype="multipart/form-data"  name="form_up" id="form_up" onsubmit="start(); return Checkfiles(this);">
    what i need is, if "function checkfiles" returns no error or no alert then "function start" should work otherwise not.

    vineet

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    What you ask is easy:
    Code:
    <form action="" method="post"
          enctype="multipart/form-data"
          name="form_up"
          id="form_up"
          onsubmit="return Checkfiles(this) && start();">
    What you need, however, is not possible: in most modern browsers, the values of file inputs are inaccessible for security reasons.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Jun 2008
    Posts
    121
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default call function

    Quote Originally Posted by Twey View Post
    What you ask is easy:
    Code:
    <form action="" method="post"
          enctype="multipart/form-data"
          name="form_up"
          id="form_up"
          onsubmit="return Checkfiles(this) && start();">
    What you need, however, is not possible: in most modern browsers, the values of file inputs are inaccessible for security reasons.
    hi Twey

    thanks. It works for me in latest IE7 and FF3.

    dont know about rest of old browsers.

    VINEET

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
  •