Hi I need to toggle the text on an html input button in a .net web application.
the name of the button is btn_hide and I do have an onclick function for it.
<script language="javascript" type="text/javascript">
// <!CDATA[
function btn_hide_onclick()
{
}
// ]]>
</script>

Signature
thanks,
Paul G
Software engineer.
> <script language="javascript" type="text/javascript">
Firstly, get rid of the language tag, as that's deprecated syntax...
> Hi I need to toggle the text on an html input button in a .net web
> application.
Toggle? From what to what? I.e. what precisely do you want to happen when a
user clicks the button...?

Signature
Mark Rae
ASP.NET MVP
http://www.markrae.net
Paul - 28 Mar 2008 20:53 GMT
hi thanks for the response. I got it working by toggling the state of a
variable, just wanted the text to change back and forth each time the user
clicks on it. hide,expand,hide,expand. Should the
<script language="javascript" type="text/javascript">
be removed?
I double clicked on the input button in the aspx page and the designer in
vs2005 auto created this tag.

Signature
Paul G
Software engineer.
> > <script language="javascript" type="text/javascript">
>
[quoted text clipped - 5 lines]
> Toggle? From what to what? I.e. what precisely do you want to happen when a
> user clicks the button...?
Mark Rae [MVP] - 28 Mar 2008 23:58 GMT
> just wanted the text to change back and forth each time the user clicks on
> it
OK, but change from what to what...?
> Should the <script language="javascript" type="text/javascript"> be
> removed?
No. As I said, the language tag should be removed as it is deprecated:
http://www.google.co.uk/search?sourceid=navclient&aq=t&hl=en-GB&ie=UTF-8&rlz=1T4
GZEZ_en-GBGB252GB252&q=language+javascript+deprecated

Signature
Mark Rae
ASP.NET MVP
http://www.markrae.net
Paul - 31 Mar 2008 15:58 GMT
ok thanks I removed the language tag. I am changing the value of the button
from hide to expand as I am collapsing and expanding a panel.

Signature
Paul G
Software engineer.
> > just wanted the text to change back and forth each time the user clicks on
> > it
[quoted text clipped - 6 lines]
> No. As I said, the language tag should be removed as it is deprecated:
> http://www.google.co.uk/search?sourceid=navclient&aq=t&hl=en-GB&ie=UTF-8&rlz=1T4
GZEZ_en-GBGB252GB252&q=language+javascript+deprecated
Quick 'n' Dirty:
<script type="text/javascript">
function toggle()
{
value = document.getElementById("myButt").value;
if(value=="First")
document.getElementById("myButt").value="Second";
else
document.getElementById("myButt").value="First";
}
</script>
<input type = "button" id="myButt" value="First" onclick="toggle();"/>
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short Urls & more: http://ittyurl.net
> Hi I need to toggle the text on an html input button in a .net web application.
> the name of the button is btn_hide and I do have an onclick function for it.
[quoted text clipped - 9 lines]
> // ]]>
> </script>
Paul - 31 Mar 2008 16:02 GMT
ok thanks it works!

Signature
Paul G
Software engineer.
> Quick 'n' Dirty:
>
[quoted text clipped - 29 lines]
> > // ]]>
> > </script>