Results 1 to 6 of 6

Thread: Javascript problem on refresh

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2002
    Posts
    492

    Javascript problem on refresh

    I am having a problem that I cant figure out. What I am currently doing, is when you select a value in a dropdown certain text displays based on your selection, but when I refresh the page, the text gets wipped out. I need the text to remain there when the page gets refreshed. I tried calling the function that shows/hides text onload but that doesnt seem to be working either.

    Please help!!

    This is my javascript code that changes the text that gets displayed.
    Code:
    <script language="JavaScript">
    <!--
    function ShowHide(v, x) { 
      if (v.value == "2D")
        x.style.display = "block";
      else if (v.value == "1T")
        x.style.display = "block";
      else if (v.value == "SS")
        x.style.display = "block";
      else
        x.style.display = "none";
    }
    
    function doLoad() {
    	ShowHide(document.form[0].var5.value, showOptionsThurs);
    }
    		
    // end -->
    </script>
    
    <BODY ONLOAD="javascript:doLoad()">
    This is the code for the dropdown that I am using.
    Code:
    <SELECT id="var5"  NAME="dropown_var5" class="text" onClick="ShowHide(this, showOptionsThurs);">
    
    <OPTION VALUE=""> ---------- Please Select One ----------
    <OPTION VALUE="EO"> EO
    <OPTION VALUE="2D"> 2D
    <OPTION VALUE="1T"> 1T
    <OPTION VALUE="1F"> 1F
    <OPTION VALUE="SS"> SS
    												</SELECT>
    This is the code that is used to display the text.
    Code:
    <tr id="showOptionsThurs" STYLE="DISPLAY:NONE;" >
    	<TD colspan="1">
    		Display Text
    	</TD>
    </tr>
    Last edited by mrstuff68; Jun 9th, 2007 at 01:30 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width