Browse Button???

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dj_jamz102
Forum Newbie
Posts: 6
Joined: Sat Apr 19, 2008 7:11 pm

Browse Button???

Post by dj_jamz102 »

Hello

I need a code that do the browsing method which do not use a <input type="file" name=""> control. Best exmaple here is the friendster page in upload photos. Thank you!
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

Re: Browse Button???

Post by aceconcepts »

Why don't you want to use type="file"?
dj_jamz102
Forum Newbie
Posts: 6
Joined: Sat Apr 19, 2008 7:11 pm

Re: Browse Button???

Post by dj_jamz102 »

It's not so important to see the directory of the path being browsed, so i decided not to include the text field on it.. Is their any option on this aside of using an input in html? May be it can a a script code or whatever?
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

Re: Browse Button???

Post by aceconcepts »

You might be able to find an Ajax or JS approach. However, I've never required a standalone browse button so i'm not entirely sure if you can tell html to hide the textbox or any alternative methods.
dj_jamz102
Forum Newbie
Posts: 6
Joined: Sat Apr 19, 2008 7:11 pm

Re: Browse Button???

Post by dj_jamz102 »

so, do you know any site or link that you think may help on this?
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

Re: Browse Button???

Post by aceconcepts »

<input type=file> is the only supported way for a browser to upload a file.

the browse is implemented by the bowser, and the only attibute that client script can look at is the filename, no size or mimetype (though you could maybe derive this from the extension).
REF: bruce barker http://www.sqlwork.com
dj_jamz102
Forum Newbie
Posts: 6
Joined: Sat Apr 19, 2008 7:11 pm

Re: Browse Button???

Post by dj_jamz102 »

OK.. Thank's a lot.

I would like to ask you something; have you been in friendster web page then in upload photos? If you've been there, I would like to ask you if do you have some idea on how is it done? Thank you..
User avatar
markusn00b
Forum Contributor
Posts: 298
Joined: Sat Oct 20, 2007 2:16 pm
Location: York, England

Re: Browse Button???

Post by markusn00b »

They use input type="file" they just style the button using css.
dj_jamz102
Forum Newbie
Posts: 6
Joined: Sat Apr 19, 2008 7:11 pm

Re: Browse Button???

Post by dj_jamz102 »

markusn00b wrote:They use input type="file" they just style the button using css.
is it a css only? I think there is something behind aside from css.
User avatar
markusn00b
Forum Contributor
Posts: 298
Joined: Sat Oct 20, 2007 2:16 pm
Location: York, England

Re: Browse Button???

Post by markusn00b »

dj_jamz102 wrote:
markusn00b wrote:They use input type="file" they just style the button using css.
is it a css only? I think there is something behind aside from css.
There really isn't.

I looked at the source code and it uses input type="file" - the reason it looks different is because they have styled it differently.
dj_jamz102
Forum Newbie
Posts: 6
Joined: Sat Apr 19, 2008 7:11 pm

Re: Browse Button???

Post by dj_jamz102 »

markusn00b wrote:
dj_jamz102 wrote:
markusn00b wrote:They use input type="file" they just style the button using css.
is it a css only? I think there is something behind aside from css.
There really isn't.

I looked at the source code and it uses input type="file" - the reason it looks different is because they have styled it differently.
I guess I have to find my own ways..Nevermind.. Thank you!
Need help on this..

I have a browse button using <input type="file"> and a submit button using <input type="submit">. By default the submit button is disabled unless the browse button is click then open a new browse window to browse a file at the same time submit button is enabled. When the time the browse window is canceled or closed i want the submit button to be disabled again just the default. How can I do this?
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

Re: Browse Button???

Post by aceconcepts »

You would need to determine the result of an event

i.e. from the browse, did the user actually select a file to upload?

if so then enable the submit button.
Post Reply