36 users online (0 members and 36 guests)  


  Results 1 to 2 of 2

Related

  1. Back button.    Forum: PHP Forum
    Replies: 1
  2. Disable Refresh and Back button??    Forum: HTML Forum
    Replies: 27
  3. back button problems    Forum: General Discussion
    Replies: 3
  4. back button problems    Forum: HTML Forum
    Replies: 1
  1. #1
    gncreditcards's Avatar
    New User

    Status
    Offline
    Join Date
    Jan 2008
    Posts
    5

    Question Button back and next

    HI
    I'm trying that the buttons next and back, run in the script.

    If you select the option Test1 the script work but if you select the option Test2 and test2 don't work

    What I can do?
    thanks

    Code:
    <style type="text/css">
    #sddm {	margin: 0;	 padding: 0; z-index: 30; position:absolute;}
    
    #sddm li {	margin: 0;	padding: 0;	list-style: none;	float: left;}
    
    #sddm li a {	display: block;	margin: 0 1px 0 0;	padding: 4px 10px;	width: 60px;	}
    </style>
    <script language="JavaScript" type="text/javascript">
    var timeout	= 500;
    var closetimer	= 0;
    var ddmenuitem	= 0;
    function mopen(id)
    {	
    	mcancelclosetime();
    		if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
    	
    	ddmenuitem = document.getElementById(id);
    	ddmenuitem.style.visibility = 'visible';
    } function mclose(){
    	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
    } function mclosetime(){
    	closetimer = window.setTimeout(mclose, timeout);
    } function mcancelclosetime() {
    	if(closetimer)
    	{
    		window.clearTimeout(closetimer);
    		closetimer = null;
    	}
    }
    document.onclick = mclose; 
    </script>
    <script type="text/javascript">
    <!--
    function switchDiv(div_id)
    {
      var style_sheet = getStyleObject(div_id);
      if (style_sheet)
      {
        hideAll();
        changeObjectVisibility(div_id,"visible");
      }  else  {
        alert("sorry, this only works in browsers that do Dynamic HTML");
      }
    }
    function hideAll()
    {
       changeObjectVisibility("ma1ob1","hidden");
       changeObjectVisibility("ma1ob2","hidden");	 
    }
    function getStyleObject(div_id) {
      if(document.getElementById && document.getElementById(div_id)) { 
    	return document.getElementById(div_id).style;
       }   else if (document.all && document.all(div_id)) {  
    	return document.all(div_id).style;
       }   else if (document.layers && document.layers[div_id]) { 
    	return document.layers[div_id];
       } else {
    	return false;
       }
    }
    function changeObjectVisibility(div_id, newVisibility) {
           var styleObject = getStyleObject(div_id);
        if(styleObject) {
    	styleObject.visibility = newVisibility;
    	return true;
        } else {
    	return false;
        }
    }
    // -->
    </script>
    <ul id="sddm">
    <li><a href="#">Contact</a></li>
    <li><a href="#">HELP</a></li>
        <li><a href="#" 
            onmouseover="mopen('m1')" 
            onmouseout="mclosetime()">TEST</a>
            <div id="m1" 
                onmouseover="mcancelclosetime()" 
                onmouseout="mclosetime()">
            <a href="#" onclick="switchDiv('ma1ob1')"/>test1</a>
            <a href="#" onclick="switchDiv('ma1ob2')"/>test2</a>
    				<a href="#" onclick="switchDiv('ma1ob3')"/>test2</a>
             </div></li></ul>
    <div style="clear:both"></div>
    <script language="JavaScript" type="text/javascript">
    /* THIS IS THE SCRIPT I WANT TO FIX THANKS			*/
    function changeImage()
    {
    	var list = document.getElementById('s2');
    	//document.mainimage.src = list.options[list.selectedIndex].value;
    }
    
    function prevImage()
    {
    	var list = document.getElementById('s2');
    	if(list.selectedIndex == 0)
    	{
    		list.selectedIndex = list.options.length-1;
    	}	else	{
    		list.selectedIndex--;
    	}	changeImage();
    }
    
    function nextImage()
    {
    	var list = document.getElementById('s2');
    	if(list.selectedIndex == list.options.length-1)
    	{
    		list.selectedIndex = 0;
    	}	else	{
    		list.selectedIndex++;
    	} 	changeImage();
    }
    </script><br>
    <table summary="" border=1 align="CENTER">
    <tr><td align="right"><input type="button" value="<- Back" onClick="javascript:prevImage()">
    <input type="button" value="Next->" onClick="javascript:nextImage()"></td></tr>
    </table>
    <BR><BR>
        <div  id="ma1ob1" style="position:absolute;visibility:hidden;top:50px;left:10px;border-width:thick thick thick thick; border-color:green; ">
        <form name="form1" ><a>
          <select name="select763" id="s2" size="50" WIDTH="120" STYLE="width: 120px" onChange="javascript:changeImage()"> 
          <option value="none" selected="selected">Select</option>
          <option value="1">GOOD JOB</option>
        	<option value="2">EXCELENT</option>
        	<option value="3">NICE</option>
        	<option value="4">WOW</option>
        </select></a></form></div>
        <div  id="ma1ob2" style="position:absolute;visibility:hidden;top:50px;left:10px;border-width:thick thick thick thick; border-color:red; ">
        <form name="form2"><a>
        <select name="select763" id="s2"size="50" WIDTH="120" STYLE="width: 120px"  onChange="javascript:changeImage()">
        <option value="none" selected="selected">Select </option>
        <option value="1">THANKS</option>
        <option value="2">CONGRATULATION</option>
        </select></a>
        </form></div>
    		  <div  id="ma1ob3" style="position:absolute;visibility:hidden;top:50px;left:10px;border-width:thick thick thick thick; border-color:green; ">
        <form name="form1" ><a>
          <select name="select763" id="s2" size="50" WIDTH="120" STYLE="width: 120px" onChange="javascript:changeImage()"> 
          <option value="none" selected="selected">Select</option>
          <option value="1">NOT GOOD</option>
        	<option value="2">BETTER LUCKY</option>
        	<option value="3">NEXT TIEM</option>
        	<option value="4">SORRY</option>
        </select></a></form></div>
    Last edited by HTML; 06-04-2008 at 08:36 AM. Reason: Added code tags

  2. #2
    vinyl-junkie's Avatar
    Moderator

    Status
    Offline
    Join Date
    Sep 2005
    Posts
    721

    Re: Button back and next

    Without looking at your code, I would say to first look at the rendered page. You should be able to see from that just how the link is being written, and should be able to correct the code. If that doesn't work for you, try to be a little more specific on what you're expecting to see. Then we'll be able to offer some guidance.
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more



Tags for this Thread