1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

changing the button name after each click

Discussion in 'Web Design, HTML And CSS Forums' 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