Connecting Tech Pros Worldwide Forums | Help | Site Map

cool submit button switching when pressed

Greg Bryant
Guest
 
Posts: n/a
#1: Jul 17 '05
I saw it somewhere the other day, and just saw it again on the pear.php.net
search page. When you click the "submit" button, it switches to a grayed
out "processing" button. I glanced at the source, but I don't see anything
special. Anyone know how this is done?

Thanks,
-G

Andy Hassall
Guest
 
Posts: n/a
#2: Jul 17 '05

re: cool submit button switching when pressed


On Mon, 01 Dec 2003 00:39:19 GMT, Greg Bryant <bryantgHELLO@yahoo.com> wrote:
[color=blue]
>I saw it somewhere the other day, and just saw it again on the pear.php.net
>search page. When you click the "submit" button, it switches to a grayed
>out "processing" button. I glanced at the source, but I don't see anything
>special. Anyone know how this is done?[/color]

JavaScript.

--
Andy Hassall (andy@andyh.co.uk) icq(5747695) (http://www.andyh.co.uk)
Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)
Alvaro G Vicario
Guest
 
Posts: n/a
#3: Jul 17 '05

re: cool submit button switching when pressed


*** Greg Bryant wrote/escribió (Mon, 01 Dec 2003 00:39:19 GMT):[color=blue]
> I saw it somewhere the other day, and just saw it again on the pear.php.net
> search page. When you click the "submit" button, it switches to a grayed
> out "processing" button. I glanced at the source, but I don't see anything
> special. Anyone know how this is done?[/color]

It's probably using some good old JavaScript to change the "disabled"
attribute of the button. Check source code again and you'll find it.


--
--
-- Álvaro G. Vicario - Burgos, Spain
--
Ingo
Guest
 
Posts: n/a
#4: Jul 17 '05

re: cool submit button switching when pressed



"Greg Bryant" <bryantgHELLO@yahoo.com> schrieb im Newsbeitrag
news:Xns9443BDC362B57bryantgHELLOyahoocom@199.45.4 9.11...[color=blue]
> I saw it somewhere the other day, and just saw it again on the[/color]
pear.php.net[color=blue]
> search page. When you click the "submit" button, it switches to a grayed
> out "processing" button. I glanced at the source, but I don't see[/color]
anything[color=blue]
> special. Anyone know how this is done?
>
> Thanks,
> -G[/color]

Try this:

<input type="Submit" name="submit" value="Jetzt anmelden"
OnClick="this.disabled=true; this.form.submit();">

to change text add "this.value='processing';"


Ingo (Germany)


Greg Bryant
Guest
 
Posts: n/a
#5: Jul 17 '05

re: cool submit button switching when pressed


"Ingo" <HoschiIngo@gmx.de> wrote in
news:bqg9t0$k4r$06$1@news.t-online.com:
[color=blue]
>
> "Greg Bryant" <bryantgHELLO@yahoo.com> schrieb im Newsbeitrag
> news:Xns9443BDC362B57bryantgHELLOyahoocom@199.45.4 9.11...[color=green]
>> I saw it somewhere the other day, and just saw it again on the[/color]
> pear.php.net[color=green]
>> search page. When you click the "submit" button, it switches to a
>> grayed out "processing" button. I glanced at the source, but I don't
>> see[/color]
> anything[color=green]
>> special. Anyone know how this is done?
>>
>> Thanks,
>> -G[/color]
>
> Try this:
>
> <input type="Submit" name="submit" value="Jetzt anmelden"
> OnClick="this.disabled=true; this.form.submit();">
>
> to change text add "this.value='processing';"
>
>
> Ingo (Germany)
>
>
>[/color]

Thanks, I figured it had to be something like that, but the source for
the page (found at http://pear.php.net/package-search.php ) only has
<input type="submit" name="submitButton" value="Search" />

Enjoy,
-G
Andy Hassall
Guest
 
Posts: n/a
#6: Jul 17 '05

re: cool submit button switching when pressed


On Mon, 01 Dec 2003 23:27:36 GMT, Greg Bryant <bryantgHELLO@yahoo.com> wrote:
[color=blue]
>Thanks, I figured it had to be something like that, but the source for
>the page (found at http://pear.php.net/package-search.php ) only has
><input type="submit" name="submitButton" value="Search" />[/color]

Look at the <form> element.

--
Andy Hassall (andy@andyh.co.uk) icq(5747695) (http://www.andyh.co.uk)
Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)
Greg Bryant
Guest
 
Posts: n/a
#7: Jul 17 '05

re: cool submit button switching when pressed


Andy Hassall <andy@andyh.co.uk> wrote in
news:tujnsv4m55nj8g5hh61gasv4lcutteeced@4ax.com:
[color=blue]
> On Mon, 01 Dec 2003 23:27:36 GMT, Greg Bryant <bryantgHELLO@yahoo.com>
> wrote:
>[color=green]
>>Thanks, I figured it had to be something like that, but the source for
>>the page (found at http://pear.php.net/package-search.php ) only has
>><input type="submit" name="submitButton" value="Search" />[/color]
>
> Look at the <form> element.
>[/color]

Ah - that's it. Learning all the time - good stuff. Thanks!

-Greg
FLEB
Guest
 
Posts: n/a
#8: Jul 17 '05

re: cool submit button switching when pressed


Regarding this well-known quote, often attributed to Ingo's famous "Mon, 1
Dec 2003 21:55:57 +0100" speech:
[color=blue]
> "Greg Bryant" <bryantgHELLO@yahoo.com> schrieb im Newsbeitrag
> news:Xns9443BDC362B57bryantgHELLOyahoocom@199.45.4 9.11...[color=green]
>> I saw it somewhere the other day, and just saw it again on the[/color]
> pear.php.net[color=green]
>> search page. When you click the "submit" button, it switches to a grayed
>> out "processing" button. I glanced at the source, but I don't see[/color]
> anything[color=green]
>> special. Anyone know how this is done?
>>
>> Thanks,
>> -G[/color]
>
> Try this:
>
> <input type="Submit" name="submit" value="Jetzt anmelden"
> OnClick="this.disabled=true; this.form.submit();">
>
> to change text add "this.value='processing';"
>
>
> Ingo (Germany)[/color]

Is the "disabled" property standards-compliant? I thought you had to use
CSS/DHTML JavaScript to do that (which is, BTW, a more versatile way,
although somewhat more difficult.)

--
-- Rudy Fleminger
-- sp@mmers.and.evil.ones.will.bow-down-to.us
(put "Hey!" in the Subject line for priority processing!)
-- http://www.pixelsaredead.com
Alvaro G Vicario
Guest
 
Posts: n/a
#9: Jul 17 '05

re: cool submit button switching when pressed


*** FLEB wrote/escribió (Wed, 3 Dec 2003 02:51:21 -0500):[color=blue][color=green]
>> OnClick="this.disabled=true; this.form.submit();">[/color][/color]
[color=blue]
> Is the "disabled" property standards-compliant? I thought you had to use
> CSS/DHTML JavaScript to do that[/color]

I thought DHTML was using JavaScript to change HTML... :-?


--
--
-- Álvaro G. Vicario - Burgos, Spain
--
FLEB
Guest
 
Posts: n/a
#10: Jul 17 '05

re: cool submit button switching when pressed


Regarding this well-known quote, often attributed to Alvaro G Vicario's
famous "Wed, 3 Dec 2003 11:02:08 +0100" speech:
[color=blue]
> *** FLEB wrote/escribió (Wed, 3 Dec 2003 02:51:21 -0500):[color=green][color=darkred]
>>> OnClick="this.disabled=true; this.form.submit();">[/color][/color]
>[color=green]
>> Is the "disabled" property standards-compliant? I thought you had to use
>> CSS/DHTML JavaScript to do that[/color]
>
> I thought DHTML was using JavaScript to change HTML... :-?
>
>
> --[/color]

Yes, it is, but I explicitly mentioned JavaScript for clarity.

--
-- Rudy Fleminger
-- sp@mmers.and.evil.ones.will.bow-down-to.us
(put "Hey!" in the Subject line for priority processing!)
-- http://www.pixelsaredead.com
Tim Tyler
Guest
 
Posts: n/a
#11: Jul 17 '05

re: cool submit button switching when pressed


Greg Bryant <bryantgHELLO@yahoo.com> wrote or quoted:[color=blue]
> "Ingo" <HoschiIngo@gmx.de> wrote in[/color]
[color=blue][color=green]
>> Try this:
>>
>> <input type="Submit" name="submit" value="Jetzt anmelden"
>> OnClick="this.disabled=true; this.form.submit();">
>>
>> to change text add "this.value='processing';"[/color]
>
> Thanks, I figured it had to be something like that, but the source for
> the page (found at http://pear.php.net/package-search.php ) only has
> <input type="submit" name="submitButton" value="Search" />[/color]

No - there are two forms on that page - and the other one reads:

<form action="/package-search.php" method="get" name="search_form"
onsubmit="validate_form()">

The greying is done in the validate_form() method.
--
__________
|im |yler http://timtyler.org/ tim@tt1lock.org Remove lock to reply.
Tim Tyler
Guest
 
Posts: n/a
#12: Jul 17 '05

re: cool submit button switching when pressed


FLEB <soon.the.sp@mmers.and.evil.ones.will.bow-down-to.us> wrote or quoted:[color=blue]
> Regarding this well-known quote, often attributed to Alvaro G Vicario's
> famous "Wed, 3 Dec 2003 11:02:08 +0100" speech:[color=green]
>> *** FLEB wrote/escribió (Wed, 3 Dec 2003 02:51:21 -0500):[/color][/color]
[color=blue][color=green][color=darkred]
>>> Is the "disabled" property standards-compliant? I thought you had to use
>>> CSS/DHTML JavaScript to do that[/color]
>>
>> I thought DHTML was using JavaScript to change HTML... :-?[/color]
>
> Yes, it is, but I explicitly mentioned JavaScript for clarity.[/color]

You are asking whether there are DHTML/CSS/JavaScript standards,
and if they support the "disabled" flag?

I think the answer it "yes".

Certainly, the page in question works in IE, Mozilla and Opera.
--
__________
|im |yler http://timtyler.org/ tim@tt1lock.org Remove lock to reply.
Closed Thread