TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

April 18, 2024, 09:41:05 PM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,164
  • Total Topics: 21,219
  • Online today: 203
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 1
  • Guests: 61
  • Total: 62
  • @rjen

a small javascript question

Started by rbh, October 11, 2006, 04:35:26 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

rbh

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.

akulion


rbh

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

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

good u got it worked out :up:

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

rbh

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

Thurnok

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

#7
Quote from: akubear on October 11, 2006, 06:22:47 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?

LeeD

#8
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