HTML Help Forum HTML Help
Please Search for the answer to your question before asking it! Thanks.
 

[solved] html+java dropdown url form
Post a Reply to this Topic Ask a New Question
Click here to go to the original topic
       HTML Help Forum -> Javascript
View previous topic :: View next topic  
Author Message
indi



Joined: 03 Dec 2009
Posts: 7

Posted: Thu Dec 03, 2009 1:10 pm     [solved] html+java dropdown url form  

Hey chaps and chapettes,

I'm pretty new to web design and am learning as I go. I'm putting together a local site as a practice project. I'm using it to catalogue my media files and link to my commonly visited sites etc. Kind of an all inclusive local home page.

Anyway, the issue I'm (currently) having is with a dropdown box that I want to open a new tab to run a search on a torrent site. I have a table with two cells and a dropdown box in each. The first is functioning correctly and linking to a tv listing site, no issues there. The second however is not doing anything (that I can tell).
The only difference between the two that I can see is the second has "?"s in the urls where the first doesn't.

Is there a syntax to use if including a "?"? An escape character or something? Or am I just missing the blatant error that's staring me in the face?

Here's what I've got:
Code: <table width="100%">
<tr>
<td style="text-align: center;">
<form name="epg">
<select name="seriesurl" onchange="window.open(epg.seriesurl.options[selectedIndex].value)">
<option> EPGuides.com </option>
<option> .... </option>
<option value="http://epguides.com/BlackBooks/"> Black Books </option>
<option value="http://epguides.com/BurnNotice/"> Burn Notice </option>
<option value="http://epguides.com/Chuck/"> Chuck </option>
<option value="http://epguides.com/CodeMonkeys/"> Code Monkeys </option>
<option value="http://epguides.com/Dexter/"> Dexter </option>
<option value="http://epguides.com/Dollhouse/"> Dollhouse </option>
<option value="http://epguides.com/Eureka/"> Eureka </option>
<option value="http://epguides.com/GreenWing/"> Green Wing </option>
<option value="http://epguides.com/Hyperdrive/"> Hyperdrive </option>
<option value="http://epguides.com/ITCrowd/"> IT Crowd </option>
<option value="http://epguides.com/MightyBoosh/"> Mighty Boosh </option>
<option value="http://epguides.com/Spaced/"> Spaced </option>
<option> .... </option>
</select>
</td>
<td style="text-align: center;">
<form name="ipt">
<select name="searchurl" onchange="window.open(ipt.searchurl.options[selectedIndex].value)">
<option> IPT Search </option>
<option> .... </option>
<option value="http://www.iptorrents.com/browse.php?c4=1&amp;search=bones&amp;incldead=0"> Bones </option>
<option value="http://www.iptorrents.com/browse.php?c4=1&amp;search=Burn+Notice&amp;incldead=0"> Burn Notice </option>
<option value="http://www.iptorrents.com/browse.php?c4=1&amp;search=chuck&amp;incldead=0"> Chuck </option>
<option value="http://www.iptorrents.com/browse.php?c4=1&amp;search=dexter&amp;incldead=0"> Dexter </option>
<option value="http://www.iptorrents.com/browse.php?c4=1&amp;search=dollhouse&amp;incldead=0"> Dollhouse </option>
<option value="http://www.iptorrents.com/browse.php?c4=1&amp;search=eureka&amp;incldead=0"> Eureka </option>
<option value="http://www.iptorrents.com/browse.php?c4=1&amp;search=fringe&amp;incldead=0"> Fringe </option>
<option value="http://www.iptorrents.com/browse.php?c4=1&amp;search=heroes&amp;incldead=0"> Heroes </option>
<option value="http://www.iptorrents.com/browse.php?c4=1&amp;search=sanctuary&amp;incldead=0"> Sanctuary </option>
<option value="http://www.iptorrents.com/browse.php?c4=1&amp;search=stargate+universe&amp;incldead=0"> SG:U </option>
<option> .... </option>
</select>
</form>
</td>
</tr>
</table>
I know that you folks won't be able to see the search results unless you're also a member of the site but if the new tab/window tries to load that should be it working.

Any and all suggestions welcome.

Also, is there a better way that I should be implementing this?
Straystudio



Joined: 14 Apr 2008
Posts: 308
Location: Nord Italy

Posted: Thu Dec 03, 2009 11:09 pm      

<option> .... </option>
</select>
</form>
</td>
<td style="text-align: center;">

Lacking closing Tag for the first FORM, makes the second one to be a form inside a form so, ipt.searchurl is unable to find it.


URLs may want ampersands for variables sent via GET, not to be codified:

http://www.iptorrents.com/browse.php?c4=1&amp;search=Burn+Notice&amp;incldead=0

http://www.iptorrents.com/browse.php?c4=1&search=Burn+Notice&incldead=0

wishes from Nord-Tuscany/Liguria ...
indi



Joined: 03 Dec 2009
Posts: 7

Posted: Fri Dec 04, 2009 1:46 am      

Blatent error it was then!

Thanks, I'm in work now but I'll test it at home later.
indi



Joined: 03 Dec 2009
Posts: 7

Posted: Mon Dec 07, 2009 1:23 am      

Quick update to let you know that after closing the form it all worked as expected.
No need to change the "&amp" to "&". It worked perfectly in FF3 and in Chrome.

Thanks for the aid.
 
 
DARFUR
HOSTING / DESIGN

       HTML Help Forum -> Javascript
Page 1 of 1


Powered by phpBB Search Engine Indexer
Powered by phpBB 2.0.19 © 2001, 2002 phpBB Group