anyone good with java script-toggle text on input button

P

Paul

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>
 
M

Mark Rae [MVP]

<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...?
 
P

Paul

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.
 
P

Paul

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.
 
P

Paul

ok thanks it works!
--
Paul G
Software engineer.


Peter Bromberg said:
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


Paul said:
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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top