Login  |  Register
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome, Guest. Please login or register.
Did you miss your activation email?

August 19, 2022, 05:38:02 AM

Login with username, password and session length
Members
  • Total Members: 3843
  • Latest: Tricky
Stats
  • Total Posts: 193479
  • Total Topics: 21088
  • Online today: 54
  • Online ever: 1035
  • (November 26, 2020, 04:45:12 AM)
Users Online
Users: 1
Guests: 54
Total: 55

Author Topic: a small javascript question  (Read 8621 times)

0 Members and 1 Guest are viewing this topic.

rbh

  • Guest
a small javascript question
« on: October 11, 2006, 09:35:26 AM »
ok, i have a simple dropdown menu script i am using for loading links into an iframe. it works fine other then i would rather have a button instead of instant load for the links. i have changed various things and cannot get it to work correctly while still loading into my iframe. on the other side, i have tried various dropdown scripts with buttons and cannot get them to load into an iframe after adjusting. can someone show me what to change with this script so that links are loaded by clicking a button. i know how to put the button there, but i think something with the onchange= needs to be changed?

<form name="menu">
<SELECT onchange="window.open(this.options[this.selectedIndex].value,'MYIFRAME')">
<OPTION VALUE="myurl">
</SELECT>
</FORM>



EDIT: ok, i finally pieced together a working menu as i described. this will load target links from a dropdown menu into your iframe with a button rather then autoloading the link as the above code does.

<form name="rss">
<select name="test">
<option value="URL">LINK NAME</option>
</select> <input type="button" value="Go" onClick="parent.MYIFRAME.location.href=document.rss.test.options[document.rss.test.selectedIndex].value">
</form>


in the above snippets change the stuff in red and the parts in blue can be changed just keep them the same in all places.
« Last Edit: October 11, 2006, 01:43:08 PM by rbh »

akulion

  • Guest
Re: a small javascript question
« Reply #1 on: October 11, 2006, 11:22:47 AM »
heres a really good one which even gives descriptions for ur links :up:
http://www.dynamicdrive.com/dynamicindex1/combodescribe.htm

rbh

  • Guest
Re: a small javascript question
« Reply #2 on: October 11, 2006, 12:33:29 PM »
i think that was one i tried but couldnt get it to open the links in my iframe. i tried to target the iframe and it just opened a new window no matter what i did. i will take a crack at it again. i have nothing but time to kill lately anyways. ;D

rbh

  • Guest
Re: a small javascript question
« Reply #3 on: October 11, 2006, 01:09:48 PM »
WHEW! i finally got things working. i frankensteined so many scripts till i hit the right combination. a little more cleaning and it should be good to go. this was a help topic but once i get it cleaned and working 100% i will edit my above post with the little snippet to have a dropdown menu, go button, and the links loaded into the iframe in case anyone else is in need of this. the above code right now loads links into an iframe from a dropdown menu but it is autoload, meaning once they choose a link it opens in the iframe, but what i finally got working will have the button for loading the links.

akulion

  • Guest
Re: a small javascript question
« Reply #4 on: October 11, 2006, 09:54:32 PM »
good u got it worked out :up:

thanks for sharin the script - it will come in handy for sure :up:

rbh

  • Guest
Re: a small javascript question
« Reply #5 on: October 11, 2006, 10:02:12 PM »
not a problem......i will add to the above, after more frustration, that if you use more then one of these menus in a block you need to change the names of each one for example

first menu
<form name="rss1">

second menu
<form name="rss2">

and make those changes in the rest of the script for the parts in blue. this is probably common knowledge for you upper crust coders but had me going crazy for awhile. ;D

Offline Thurnok

  • Friends
  • *
  • Posts: 784
Re: a small javascript question
« Reply #6 on: October 12, 2006, 05:41:38 PM »
You can take a look at my Custom Page block for some info on how to do that with Javascript.  Look at the selectedChange() function for the javascript command.  It performs it via the pull down change, but you can just as easily call it via a button instead.

me123

  • Guest
Re: a small javascript question
« Reply #7 on: May 30, 2008, 03:43:39 PM »
heres a really good one which even gives descriptions for ur links :up:
http://www.dynamicdrive.com/dynamicindex1/combodescribe.htm


Here is what I want to do: In the middle block, I will put the script above.(a menu appears and my visitors can select a link) OK, then I would like the link to open in my Tinyportal main window. I will uncheck the 'left block' so the page has room to open on the full width.
What code do I need for that?
« Last Edit: May 31, 2008, 08:04:05 AM by me123 »

LeeD

  • Guest
Re: a small javascript question
« Reply #8 on: November 26, 2008, 07:56:04 AM »
hi

i see this hasnt been replied to in a bit
i have a question though regarding the drop down script

is there one definate script that works
and or do you guys prefer any 1 particuliar code

no matter which code i use , i can get them to show and drop down works , and its being directed to proper links but  hit the go button it goes nowhere - like the button is dead just clicks away
that be in IE , firefox , opera no matter what browser

any clue or help would be aprreciated

would like a drop down in a right side block
« Last Edit: November 26, 2008, 07:58:02 AM by LeeD »