Link to home
Start Free TrialLog in
Avatar of anctech
anctech

asked on

Need help creating a form dropdown menu with URL Links that works with Joomla

I am trying to get the following sample code to work on an Article in Joomla 1.5.9.   The code below works just fine on a standard HTML Page, but if I use this exact same code in a Joomla Article it does nothing.  I can press the "Take me there!" button and nothing happens.

Does anyone know how to make this simple code work on a Joomla Article?


SAMPLE CODE:

<form name="hop">
<p align="center">
<select name="choose">
<option selected>Choose One</option>
<option value="http://mousetrax.com">Mousetrax</option>
<option value="http://yahoo.com">Yahoo</option>
<option value="http://microsoft.com">Microsoft</option>
<option value="http://personal-computer-tutor.com">Linda's Computer Stop</option>
<option value="http://personal-computer-tutor.com/abc">ABC Newsletter</option>
</select>
<input type="button" onClick="location=document.hop.choose.options[document.hop.choose.selectedIndex].value;" value="Take me there!"></p>
</form>
SOLUTION
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
have u checked the code inside the article after saving. Because sometimes in joomla it will clear the code.
Avatar of anctech
anctech

ASKER

yes I checked the code in Joomla.  I use the EDIT CODE feature that way I don't have to deal with the GUI editor which does mess up code sometimes.   I am going to try the suggestion by: mplungjan an will post whether or not that worked.
Avatar of anctech

ASKER

I just tried the code from mplungjan and it doesn't work either, BUT it does do more than the original code I had.     Please see the attached screenshot file.    Instead of just going to the URL address in the form, it is including the acrticle URL address in front which of course doesn't work.    

Does anyone know how to update the code so when clicking on the "Take Me There" Button, then the ONLY the URL from the drop down form will be used.

Also note that I need several of these drop down menus on the same page, so I am assuming all I would have to do is change the form name to accomplish this.  Is that correct?

Thank you.
screen-shot---form-drop-down-men.jpg
Avatar of anctech

ASKER

Is there a way to update the code so it forces the URL in the form to open on a NEW Page such as someone incorporating  target="_blank" for each of the URLS in the drop down menu?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of anctech

ASKER

Where exactly would that go in relation to your original code?     I tried adding that line at the bottom but it doesn't do anything.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of anctech

ASKER

sorry, just tested this new code and still doesn't work.
Can you show the view-source of your browser?
Avatar of anctech

ASKER

Yes I can view the page source in my browser.   What would you like me to look for?
Paste the form and script please
I do not see my link there - only a button
Avatar of anctech

ASKER

I posted two snips of the page source.  Yours is the first one that is 76kb in size.  Is that the one you looked at.
Ah, sorry missed that on my phone

I see

onclick="function onclick() { function onclick() { .... }}"

that is of course completely wrong
Avatar of anctech

ASKER

I'm about ready to just say screw it and just put standard HREF text links that I know work for sure.   I was just trying to save to realestate by using the drop down menus since I have quite  a few links thta I want on the page.

Any other suggestions?
I clicked "Request attention" for you
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of anctech

ASKER

Gave up trying to find a solution.     Expert Comments from mplungjan were very much appreciated, however even after following the expert suggestions exactly the code still did not work correctly in Joomla 1.5.  

I resorted to just using standard Href tags which worked fine.