Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New to the CF scene
    Join Date
    Aug 2006
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    problem about style.pixelTop

    I want to make a "upload multi files" component like gmail,but encounter a serious problem,the "real" browser button can't cover with the button named "upload a attachment" when mouse on it,but it only happen when the component be surrounded by <table> tag;

    thanks for your help!

    Code:
    <html>
    <br><br><br>
    <table> <!-- it works very well if delete the table tag-->
      <input type="button" name="selbtn"  size="30"  value="upload a attachment" 
    onmousemove="form1.file1.style.pixelLeft=event.x;form1.file1.style.pixelTop=this.offsetTop;"/>
      <form enctype="multipart/form-data" method="POST" name="form1">
      <input type="file" name="file1" style="position:absolute;width:0px" />
      </form>
    </table>
    </html>

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    Yes I know. As far as I know there is no workaround about this. There is no way to change the "real" button's size. In Mozilla nor you can change the whole input's size at all.
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #3
    New to the CF scene
    Join Date
    Aug 2006
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    there is just "form1.file1.style.pixelTop=this.offsetTop;" has a problem,the "form1.file1.style.pixelTop" actually always on top edge on web browser's window,not the "upload a attachment" button's offsetTop;

    is there a good idea to help me to fix the problem? or give me some other example code to show upload multi files like gmail that could be encapsulated into component easliy ;

    thanks a lot

  • #4
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    A recent one (pages are still under construction)

    http://www.mc.ro/client/zdi/contnou-agentie.php

    The Browse button... This is what you want?
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #5
    New to the CF scene
    Join Date
    Aug 2006
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Kor
    A recent one (pages are still under construction)

    http://www.mc.ro/client/zdi/contnou-agentie.php

    The Browse button... This is what you want?
    yes,but...the "real" browser button seem to small,so if I click the "pseudo" browser button anear left edge,the "real" browser button would not be clicked;

  • #6
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    as I said, as far as I know, there is no way (or I have not found it yet) to modify the button's size or the distance between the input file box and it's button.
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #7
    New to the CF scene
    Join Date
    Aug 2006
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Kor
    as I said, as far as I know, there is no way (or I have not found it yet) to modify the button's size or the distance between the input file box and it's button.
    and I posted code can't be fixed?

  • #8
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    I don't know. Post here your code, maybe someone else has a solution.
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #9
    New to the CF scene
    Join Date
    Aug 2006
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Kor
    I don't know. Post here your code, maybe someone else has a solution.
    hi,thanks for your help,I just modified a little code,and it works not bad;
    modified code snippet:
    Code:
    onmousemove="form1.file1.style.pixelLeft=event.offsetX;form1.file1.style.pixelTop=event.y-10;"
    entire code:
    Code:
    <html>
    <br><br><br>
    <table> <!-- it works very well if delete the table tag-->
        <input type="button" name="selbtn"  size="30"  value="upload a attachment" 
        onmousemove="form1.file1.style.pixelLeft=event.offsetX;form1.file1.style.pixelTop=event.y-10;"/>
        <form enctype="multipart/form-data" method="POST" name="form1">
        <input type="file" name="file1" style="position:absolute;width:0px" />
        </form>
    </table>
    </html>


  •  

    Posting Permissions

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