Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

drop-down menu first value 2

Status
Not open for further replies.

patweb

Programmer
Apr 17, 2003
174
0
0
BE
Code:
<!-- 
function writeframe(argdir, argname) 
{ 
   document.open(); 
   document.write('<html>'); 
   document.write('<head>'); 
   document.write('</head>'); 
   document.write('<frameset cols="18%,82%" framespacing="0" frameborder="0" target= "_blank">'); 
   document.write('<frame name="left" src= ' + argdir + ' target="rechts" scrolling="no" scrolbar="no">'); 
   document.write('<frame name="rechts" scrolling="auto" src= ' + argname + ' target="rechts">'); 
   document.write('<noframes>'); 
   document.write('<body>'); 
   document.write('</body>'); 
   document.write('</noframes>'); 
   document.write('</frameset>'); 
   document.write('</html>'); 
   document.close(); 
} 
//--> 
<!-- 
function goTo() 
{ 

var getal = document.form1.selectned.value; 

switch (getal) 

   { 
    case "W01" : 
      writeframe('frm/frmnldir.htm', 'frm/nl/n002.htm'); 
      break; 
   case "W02" : 
      writeframe('frm/frmnldir.htm', 'frm/nl/n054.htm'); 
      break; 
      } 
   document.form1.getElementById("selectned").selectedindex = 0 
}

I have a drop down menu on my index page, after a selection by a user he writes a frame. When using the back button the value of the drop down stands fixed on the selected item. He need to take the default value W00, the first, the title of the drop down box. I tried getElementById, but this doesn't help.

regard,pat.

 

Try this as a replacement for your last line of code above:
Code:
document.form1.selectned.selectedIndex = 0;

Hope this helps!
Jeff

 
Code:
function resetdefaultvalueselect()
{
document.getElementById("selectned").selectedIndex = 0;
}
}

I can't see why, but he's obstinate refusing to reset the default value after a selection. I tried to include this function. Should it be because he first jump to another frame ? This problems takes me hours, i get mad.

 
It will not work, as you are overwriting the contents of the page, including the select box. This means that there is no select box left to set the selectedIndex of.

In a previous thread:


You asked how to get your write code to open in a new window instead. Have you decided to abandon this method, or did you post the wrong code in this thread?

Hope this helps,
Dan


[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
 
I implemented this (so your help was very usefull) and it works. The problem was that the code takes a lot of running time and visitors do not have patient, certainly not on an index page. If you are curious about my solution I can let you know.

Your last answer is ok (now I see why this did not work), but can you say something how this can be solved ?



 

It can be solved by not overwriting the contents of your document.

Your question seems to change slightly every time you post, so if you want help with re-architecting your solution, you'd need to explain exactly what it is you are trying to do, and mention what you don't want, and why previous posts have not been helpful (did they do things you did not want?)

Hope this helps,
Dan


[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]

 
How not to overwrite ? Can I get what I want without overwriting, in this design not I think. I need to overwrite.

Development is a creative process. I you find afterwards that a solution is not sufficient for what you want you look for other solutions and sometimes you need to redesign your architecture. You said that with the first solution you can't fasten the time of the javascript code, ok, so I look for a better way and I found it without your help.

As I said above your help was very usefull at that moment and I implemented it, but afterwards I need to skip this solution.
 
I see a member asking 50+ questions and none of the advice being acknowledged with a star. Maybe those were the results of some creative processes, or from different angle, moving targets.

To get the best answer, please take a look of the faq222-2244. And keep post questions to the forums as needed.

- tsuji
 
First, perhaps I didn't marked this these with stars (how to ?) But if you read many of my threads I say sincerely thanks to those who helps (many times).

Secondly if someone can not answer my question and I find finally after (mostly a long strugly) find a solution mostly I post these back in my own threads.

Third, I do not think they are the target, in this case I think I am the target. I just ask a simple question (perhaps not an easy), how to get my default value back in my drop down menu.


 
To give a helpful poster a star you click the clearly labeled link Thank <poster> for this valuable post! It's the one that has the purple star by it at the bottom of the thread.

-kaht

Do the chickens have large talons?
 
Glad I could be of help.

-kaht

Do the chickens have large talons?
 

I agree. That was insightful and helpful information, kaht.

Dan


[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]

 
What can I say? I know my stuff.

-kaht

Do the chickens have large talons?
 
they where almost more insightfull the the best answer to my post. Because the question is still open.
 
Because the question is still open.
It would appear that your original question is in fact not open. Only after re-reading the thread 3 times was I able to realize that you are now just concerned about speed performance. Since this is off the topic of the original question asked, perhaps you should start a new thread?

-kaht

Do the chickens have large talons?
 
If you read my first post here, there is not a word about speed, its out of the question. I have a drop down menu and I overwrite this by document.write. As said in the answer (and that was a nice post) is if you overwrite you can't refer to your drop down menu in this way. Ok, but can this be solved and how ?

the target
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top