PDA

View Full Version : Switch Form



hafizbhata
11-27-2008, 09:01 PM
Hello there.

I have got an switch form script but i want it in drop down. please help.

<script type="text/javascript">
function switchforms(currVal)
{
var vlinks = document.getElementsByTagName('a');
for( var i=0; i<vlinks.length; i++ )
{
var vtempLink = vlinks[i];
if(vtempLink.id == currVal)
{
vtempLink.className = 'Bold';
document.forms['suggestions'].action = vtempLink.href;
}
else if(vtempLink.id == 'typeWeb' || vtempLink.id == 'typeVideos' || vtempLink.id == 'typeImages' || vtempLink.id == 'typeYoutube' || vtempLink.id == 'typeMsnlive' || vtempLink.id == 'typeMobile' || vtempLink.id == 'typeWapsite' || vtempLink.id == 'typeIslamic')
{
vtempLink.className = 'Normal';
}
}
}
</script>
<table align="center" border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
<tr>
<td width="100%">
<script src="http://www.freewebs.com/hafizabidayubbhata/scripts/suggestions.js"></script>
<form name="suggestions" action="http://www.google.com/search?q=">
<table align="center" border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="437" id="AutoNumber2" height="86">
<tr>
<td align="center" width="54"></td>
<td align="center" width="54"></td>
<td align="center" width="54"></td>
<td align="center" width="62"></td>
<td align="center" width="49"></td>
<td align="center" width="58"></td>
<td width="51" height="17" align="center"></td>
<td width="55" height="17" align="center"></td>
</tr>
<tr>
<td align="center" width="54"><a id="typeWeb" class="Bold" href="http://www.google.com/search" onClick="switchforms('typeWeb');return false;">Search</a></td>
<td align="center" width="54"><a id="typeImages" class="Normal" href="http://images.google.com/images" onClick="switchforms('typeImages');return false;">Images</a></td>
<td align="center" width="54"><a id="typeVideos" class="Normal" href="http://video.google.com/videosearch" onClick="switchforms('typeVideos');return false;">Videos</a></td>
<td align="center" width="62"><a id="typeYoutube" class="Normal" href="http://www.youtube.com/results?search_query=" onClick="switchforms('typeYoutube');return false;">Youtube</a></td>
<td align="center" width="48"><a id="typeIslamic" class="Normal" href="http://www.google.com/cse" onClick="switchforms('typeIslamic');return false;">Islamic</a></td>
<td align="center" width="58"><a id="typeMobile" class="Normal" href="http://www.google.co.uk/m/search?q=" onClick="switchforms('typeMobile');return false;">Mobile</a></td>
<td align="center" width="51"><a id="typeWapsite" class="Normal" href="http://mobilerunner.wap3.net/emu_wap3/p/mooobl/device.php?" onClick="switchforms('typeWapsite');return false;">Wapsite</a></td>
<td align="center" width="55"><a id="typeMsnlive" class="Normal" href="http://search.live.com/results.aspx?q=" onClick="switchforms('typeMsnlive');return false;">Live</a></td>
</tr>
<tr>
<td width="433" colspan="8" height="17">
<p align="center">
<input type="hidden" value="en" name="hl">
<input type="hidden" value="15" name="num">
<input type="hidden" value="7088116" name="id">
<input type="hidden" value="Find+pages+matching+ANY+word" name="mode">
<input type="hidden" name="pageid" value="r">
<input autocomplete="off" id="q" name="q" name="query" name="runurl" size="67">
<input name="btnG" type="submit" value="Search Now">&nbsp;&nbsp;&nbsp;&nbsp;
<input name="btnI" type="submit" value="Quick Search"></tr>
</form>
<script type="text/javascript">document.suggestions.q.focus()</script>
<tr>
<td align="center" width="54"></td>
<td align="center" width="54"></td>
<td align="center" width="54"></td>
<td align="center" width="62"></td>
<td align="center" width="49"></td>
<td align="center" width="58"></td>
<td align="center" width="51">&nbsp;</td>
<td align="center" width="55"></td>
</tr>
</table>
</center>

here is a demo site. www.gloogle.net.tc

i really need this in drop down. Thanx in advance