Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Web Design, HTML And CSS Forums (http://www.go4expert.com/forums/web-design-forum/)
-   -   changing the button name after each click (http://www.go4expert.com/forums/changing-button-click-t8679/)

rag84dec 6Feb2008 14:12

changing the button name after each click
 
hi ,
My requirement is to have an infinite loop where after each click i should get next element.And after the last element i should get the first element.
Code:

<script language="JavaScript">
function ChangeAll(f,buton,frm)
{
var mySplitResult=f.split(",");
for(i = 0; i < mySplitResult.length; i++)
{
        if(buton == mySplitResult[i])
        {
                i++;
                {
                frm.value = mySplitResult[i];
       
                if(i<mySplitResult-1)
                {
                i=0;
                }               
        }               
}
</script>

<%


DIM Definition(4)
Dim d
d="S,F,G,T"
response.write("<form method='post'>")
response.write("<input type='button' value='S' onClick='ChangeAll("""&d&""",this.value,this)'    ")
response.write("</form>")

%>


This is giving me an exception...can anyone help???..


All times are GMT +5.5. The time now is 04:53.