Page 1 of 4 123 ... LastLast
Results 1 to 10 of 31

Thread: Another gmail feature..

  1. #1
    Join Date
    Jan 2006
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Another gmail feature..

    Hi all,
    well, when there is an unanswered question there is only one place i come to..
    This time I wonder about the "attach file" link in gmail.

    It is interesting since clicking this link opens a hidden browse dialog box.

    Basically, IE does not lets you set a value for file input field, and also does not allows you to initiate an "onclick();" event on it. It is a security matter.
    If you try to do it and submit a form, the focus will be automatically set on the file input until you PRESS YOURSELF the browse button and select the file yourself.

    Gmail comes over it. It lets you initiate the browse dialog from another link and then submit the form.

    How do they do it?

    btw: is it possible to change the label on the brose button from "browse.." to something else?

  2. #2
    Join Date
    Jan 2006
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Look at the following code

    when pressing the "aaa" button it opens the browse dialog and sets the value of the real file field. but when the submit is pressed, it clears the file field and sets the focus on it. the second "File_2" field works fine.

    So how does google do this? They lets you open the browse screen from a link and the explorer handles it just fine!




    <form name="form" action="?action=save" method="post" encType="multipart/form-data">

    <input name="File_1" type="file" >

    <input name="file" type="text">

    <input name="Submit" type="submit" class="button" value="aaa" onClick="document.form.File_1.click(); document.form.file.value=document.form.File_1.value; return false;">

    <input name="submit" type="submit" class="button" value="Upload" onclick='document.form.File_1.disabled=true;'>

    <input name="File_2" type="file" >

    </form>

  3. #3
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    gmail is insane. They have a chat built into it. And a heck of a lot of other stuff.
    Have you even seen the source? There's nothing to it. It's a blank page.... just calling, with ajax, a heck of a lot of other pages.
    Crazy.
    Sorry, but not sure about this.
    Maybe they just throw the focus to the browse button and fake the enter key?
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  4. #4
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    Quote Originally Posted by djr33
    gmail is insane. They have a chat built into it. And a heck of a lot of other stuff.
    Have you even seen the source? There's nothing to it. It's a blank page.... just calling, with ajax, a heck of a lot of other pages.
    Crazy.
    Sorry, but not sure about this.
    Maybe they just throw the focus to the browse button and fake the enter key?
    Competition, Competition, Competition. G-Mail vs. Windows Live Mail
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  5. #5
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Ew. Windows. Windows Live. It's like hotmail? Meh.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  6. #6
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  7. #7
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Heh. A whole 2gb. That's what gmail started with. And now they're nearing 3.

    windows is stupid. Probably IE only as well. Heh.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  8. #8
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    No, now it's FireFox compatiable (after 2 months!)
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  9. #9
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    Forgot to mention: Invitation only. LOL
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  10. #10
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    I'm surprised.
    Not bad, considering.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

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
  •