PDA

View Full Version : Frame with textbox and two combobox, plus a buttom



C.WeeD
11-29-2010, 08:52 PM
Well, I have those objects, my problem is:
I enter the text for a search, choose the combobox of my preference, and push search buttom, so far, so good; the responce of the search appear in two frames below of the "top" frame with a form with the objects mentioned earlier,ok! but after push the buttom, the text and the selections of the combobox resets, I wanna keep that info while the visitor is in my page...someone can help me? please and thanks in advance...:confused:

Beverleyh
11-29-2010, 09:45 PM
Its very difficult to try and visualise what you describe - i'm lost - please post a link to your page.

C.WeeD
11-29-2010, 10:02 PM
Its my project of a html course, Im not have page, well not yet, maybe with the code:
<SCRIPT language="JavaScript">
function vacio(t2)
{
for ( i = 0; i < t2.length; i++ ) {
if ( t2.charAt(i) != " " ) {
return true
}
}
return false
}

function valida()
{

var F=document.form1.texto.value;

if( vacio(F) == false ) {
return false
} else {
change2()
}

}

function change2()
{

parent.left_frame.location=document.form1.combo1.options[document.form1.combo1.selectedIndex].value+document.form1.texto.value;

parent.right_frame.location=document.form1.combo2.options[document.form1.combo2.selectedIndex].value+document.form1.texto.value;


}


//-->
</HEAD>
</CENTER>
</SCRIPT>
<input type="submit" name="q" id="q" class="boton" value="Search" onclick="javascript:valida()"/>
</label> <p>
<span class="title">Choose</span></p>
<p>
<label for="combo1"></label>
<select name="combo1" id="combo1">
<option value="http://www.google.com/search?q=" selected="selected">Google</option>
<option value="http://search.yahoo.com/search?p=">Yahoo</option>
&amp;
<label for="combo2"></label>
<select name="combo2" id="combo2">
<option value="http://www.bing.com/search?q=">Bing</option>
<option value="http://es.ask.com/web?q=">Ask</option>
</select>
</p>
</form>
</CENTER>
</BODY>
</html>

C.WeeD
11-29-2010, 10:03 PM
</HEAD>
<SCRIPT language="JavaScript">
var gtext;
var gcombo1;
var gcombo2;
</SCRIPT>
<frameset rows="220,*" border="0" cols="*">
<frame src="top.htm" name="top_frame">
<FRAMESET cols="50%,50%">
<FRAME SRC="Left.htm" name="left_frame">
<FRAME SRC="Right.htm" name="right_frame">
</FRAMESET></FRAMESET><noframes></noframes>
<body>
</body>
</html>

C.WeeD
11-29-2010, 10:05 PM
I wanna keep the text and the combobox selection after click search

jscheuer1
11-30-2010, 05:23 PM
We generally don't do homework assignments here. If you've really made an effort we may give suggestions.

It's hard to tell even that though, so much code to wade through, that at least can be made a little easier if you format it in your posts:


In the future, please enclose code in:



code goes here


tags so it will look like:



code goes here


But for this type of request we would like to see you narrow down the problem for us so we don't have to wade through so much stuff to find it.

Putting up a live demo helps too, we can then use various tools to identify errors, etc., without having to first attempt to reconstruct your page from your posts.