Author Topic: Dropdown menu and iframes  (Read 579 times)

0 Members and 1 Guest are viewing this topic.

Offline iTpHo3NiX

  • EZ's Pirate Captain
  • Administrator
  • Titan
  • *
  • Posts: 2920
  • Cookies: 328
    • View Profile
    • EvilZone
Dropdown menu and iframes
« on: July 05, 2014, 03:11:31 am »
Ok so I have a page that I'm working on simplifying my work, however using static HTML does NOT do that. Here is what I'd like to accomplish

1. Header
The header.php file will include standard header information, such as logo, title, etc. This will also include a dropdown menu to select a date for the week which these options will be manually inputed

2. Content
The content will display once the selected dates are given which is an iframe of a google doc spreadsheet for schedule management

3. Footer
This will just be standard footer information and updates that may be necessary to give to supervisors.

So pretty much I just want to make a single file to include everything so I just have to add new dates to the options, and then include the iframe I want to embed to show up when the value is select.

How I'm currently doing this..

I have a static HTML page that has a little bit of javascript tweaking to enable me to embed another HTML file into it. This has saved me a lot of time from editing EVERY html file, but I want to make this easier.

So with googlefu I dound this:

Code: (html) [Select]
<select name="dest" onchange="window.open(this.options[this.selectedIndex].value,'myIFrame')">
    <option>Choose a destination for your IFrame!</option>
    <option value="http://www.yahoo.com/">YAHOO</option>
    <option value="http://www.google.com/">GOOGLE</option>
    <option value="http://www.altavista.com/">ALTAVISTA</option>
    <option value="http://www.amazon.com/">AMAZON</option>
    <option value="http://artlung.com/">ARTLUNG</option>
</select>
</form>

<iframe src="http://joecrawford.com/" name="myIFrame" width="400" height="200">
    You can't see this because your browser does not support iframes.
</iframe>

However I don't understand how I can put other iframes in for the other options. Any ideas?
[09:27] (+lenoch) iTpHo3NiX can even manipulate me to suck dick
[09:27] (+lenoch) oh no that's voluntary
[09:27] (+lenoch) sorry

Offline iTpHo3NiX

  • EZ's Pirate Captain
  • Administrator
  • Titan
  • *
  • Posts: 2920
  • Cookies: 328
    • View Profile
    • EvilZone
Re: Dropdown menu and iframes
« Reply #1 on: July 05, 2014, 03:40:53 am »
Now that I understand how the code works... I got it figured out... WAY easier and I only have 1 file to edit that I can add a month at a time and is still PHP, just have to generate my sheets share code and viola es magic... Thanks guys for making me post it here so I can see better :P I will leave my code up here for others if they want to be able to do this

Code: (html) [Select]
<html>
<head>
<title>xxxxxxx Cloud Scheduling</title>
<style type="text/css">
body {background-color:black;}
p {color:yellow;font-size:18px;}
p.larger {color:yellow;font-size:20px;text-align:center;}
h1 {text-align:center;color:yellow;}
h2 {text-align:center;color:yellow;}
</style>
</head>
<body>
<center><img src="http://www.xxxxxxxxxx.com/logo.png" height="100" width="100"></center>
<center>
<h2>Please choose from the following menu: </h2><select name="dest" onchange="window.open(this.options[this.selectedIndex].value,'schedule')">
    <option>Please Select a Date</option>
    <option value="https://docs.google.com/spreadsheets/d/xxxxx/edit?usp=sharing">July 01, 2014 - July 07, 2014</option>
    <option value="https://docs.google.com/spreadsheets/d/xxxxx/edit?usp=sharing">July 08, 2014 - July 14, 2014</option>
    <option value="https://docs.google.com/spreadsheets/d/xxxxx/edit?usp=sharing">July 15, 2014 - July 21, 2014</option>
    <option value="https://docs.google.com/spreadsheets/d/xxxxx/edit?usp=sharing">July 22, 2014 - July 28, 2014</option>
    <option value="https://docs.google.com/spreadsheets/d/xxxxx/edit?usp=sharing">July 29, 2014 - July 31, 2014</option>
</select>
</form></center>
<br />
<center><iframe frameborder="0" src="" name="schedule" width="1024" height="1600">
    You can't see this because your browser does not support iframes.
</iframe></center>
<p>If you have any issues, please contact XXXXXX XXXXXX (XXX) XXX-XXXX</p>
</body>
</html>
[09:27] (+lenoch) iTpHo3NiX can even manipulate me to suck dick
[09:27] (+lenoch) oh no that's voluntary
[09:27] (+lenoch) sorry