on 1/29/08 7:58 PM, Hamish Campbell at [EMAIL PROTECTED] wrote: > > Some code would be useful - you've said that .click() doesn't work in > FF, but it probably isn't the .click() bit that isn't working. > > One suggestion (untested) is that you include both the normal button > and the new image, but hide the image with CSS by default. This means > that if JS is disabled, the user can still click the normal button. > > Then with jQuery, hide the button and show the image on > document.ready. Then apply a trigger to the image that fires the > normal button action. It means you shouldn't need to code anything > special - just piggy-back on the usual action of the button. > > > Eg: > > $("#myImage").click(function () { > $("#fileButton").trigger('click'); > }); > > On Jan 30, 8:01 am, "Steffan A. Cline" <[EMAIL PROTECTED]> wrote: >> on 1/29/08 11:57 AM, Mika Tuupola at [EMAIL PROTECTED] wrote: >> >> >> >> >> >> >> >>> On Jan 29, 2008, at 7:08 PM, Steffan A. Cline wrote: >> >>>> I know there is a plug-in for styling file inputs but what about >>>> using a >>>> custom image instead? I need to do something where I have an ADD and a >>>> DELETE button side by side. I tried this using .click() and it worked >>>> flawlessly but alas FF does not support it! How stupid!. >> >>> What are you trying to achieve? What does ADD and DELETE buttons do? >> >>> -- >>> Mika Tuupola >>> http://www.appelsiini.net/ >> >> The add button would simply pop up the file selector as clicking on the >> actual file button would do. The delete button would set a hidden flag to >> remove the stored file. >> >> See the previous thread ".click()" This described the previous method which >> I gave up on. >> >> Thanks >> >> Steffan
Well, I tried many variations of .click() with FF and according to this link: http://www.quirksmode.org/dom/inputfile.html reads: "The click() method allows you to simulate a click on a form field. Checkboxes get toggled, radios selected, and so on. Unfortunately Mozilla and Opera haven't added this method to file upload fields. I wonder why, adding it is not really a security risk since the worst that can happen is that the file selection window pops up. So unfortunately we cannot use this simple solution." I hadn't tried your "trigger" method. Did you test it in FF? I just did and unfortunately as said on quirksmode that does not work :( but it does on everything else. What else do you suggest? Thanks Steffan --------------------------------------------------------------- T E L 6 0 2 . 7 9 3 . 0 0 1 4 | F A X 6 0 2 . 9 7 1 . 1 6 9 4 Steffan A. Cline [EMAIL PROTECTED] Phoenix, Az http://www.ExecuChoice.net USA AIM : SteffanC ICQ : 57234309 YAHOO : Steffan_Cline MSN : [EMAIL PROTECTED] GOOGLE: Steffan.Cline Lasso Partner Alliance Member ---------------------------------------------------------------