changing the button name after each click

Discussion in 'Web Design, HTML And CSS' started by rag84dec, Feb 6, 2008.

  1. rag84dec

    rag84dec New Member

    Joined:
    Jul 17, 2007
    Messages:
    49
    Likes Received:
    0
    Trophy Points:
    0
    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???..
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice