View Single Post
  #2 (permalink)  
Old April 11th, 2004, 03:47 AM
richard.york's Avatar
richard.york richard.york is offline
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 5 Times in 5 Posts
Default

Is this what you're going for?

Code:
<script language="JavaScript" type="text/javascript">

    function change_button(this_button)
    {
        document.getElementById(this_button).value = (document.getElementById(this_button).value == 'Hello')? 'World' : 'Hello';
    }

</script>

<form action="javascript:void(0);">
    <input type='submit' name'button' value='Hello' id='this_button' onclick='change_button("this_button");' />
</form>
hth,
Rich

::::::::::::::::::::::::::::::::::::::::::
The Spicy Peanut Project
http://www.spicypeanut.net
::::::::::::::::::::::::::::::::::::::::::
Reply With Quote