html help please

  • 19 Replies
  • 3763 Views
?

spacemanjones

  • 281
  • +0/-0
  • Magic pushes earth
html help please
« on: September 24, 2008, 10:33:51 PM »
Hey for anyone who knows a bit about HTML I have a few quick questions…

I am trying to create a crappy checklist. What I am looking to do is when you click one of the radio buttons new options will pop up. I have been googleing this for about an hour and all I can find is when you select a button or an option it will just send that information to you instead of opening more options.

Here is a quick example of what I am talking about…

Here are 3 options:

- option 1

- option 2

- option 3

When you select an option then it gives you more options:


- option 1  -- -- -- option 1a
                          - option 1b
- option 2           - option 1c

- option 3

*

cmdshft

  • The Elder Ones
  • 13115
  • +0/-0
  • swiggity swooty
Re: html help please
« Reply #1 on: September 24, 2008, 10:55:02 PM »
You might be able to find what you need here: http://www.htmlcodetutorial.com/

*

Parsifal

  • Official Member
  • 36019
  • +0/-0
  • Bendy Light specialist
Re: html help please
« Reply #2 on: September 25, 2008, 12:45:23 AM »
I don't know of any way to do this with pure HTML. You'd need to use Javascript, probably in combination with basic CSS (the "visibility" property in CSS would be useful here).
I'm going to side with the white supremacists.

?

MrKappa

  • 448
  • +0/-0
  • Math abstracts reality... it does not create it...
Re: html help please
« Reply #3 on: September 25, 2008, 01:14:46 AM »
This could be one way of many...

Code: [Select]
<script type="text/javascript">
function expand_collapse(obj,list_name){
document.getElementById(list_name).style.display = (obj.checked)? 'block':'none';
}
</script>


<form>

<p>
Check One:<input type="checkbox" onclick="expand_collapse(this,'list1');" checked="checked">
<div id="list1" style="display:block;">
Revealed...
</div>
</p>

<p>
Check One:<input type="checkbox" onclick="expand_collapse(this,'list2');">
<div id="list2" style="display:none;">
Not Revealed...
</div>
</p>

</form>


*

divito the truthist

  • The Elder Ones
  • 6901
  • +0/-0
  • Relativist, Existentialist, Nihilist
Re: html help please
« Reply #4 on: September 25, 2008, 07:40:52 AM »
You might be able to do it with setting up certain frames, but as far as I've ever seen, I don't think you can do it straight up with HTML alone. You'll have to look into PHP or JS like something Kappa posted.
Our existentialist, relativist, nihilist, determinist, fascist, eugenicist moderator hath returned.
Quote from: Fortuna
objectively good

*

Sexual Harassment Panda

  • 7071
  • +0/-0
  • Now more sophisticated
Re: html help please
« Reply #5 on: September 25, 2008, 11:32:55 AM »
This could be one way of many...

Code: [Select]
<script type="text/javascript">
function expand_collapse(obj,list_name){
document.getElementById(list_name).style.display = (obj.checked)? 'block':'none';
}
</script>


<form>

<p>
Check One:<input type="checkbox" onclick="expand_collapse(this,'list1');" checked="checked">
<div id="list1" style="display:block;">
Revealed...
</div>
</p>

<p>
Check One:<input type="checkbox" onclick="expand_collapse(this,'list2');">
<div id="list2" style="display:none;">
Not Revealed...
</div>
</p>

</form>

i think this looks good
and why dont you ask a html forum
|^^^^^^^^^^^\||_____          
|     STFU          |||""'|"""\___            O
| ______________|||___|__|__|)          -|- 
  (@)@)""""""**|(@)(@)**|(@)          / \

New Flat Earth FAQ: http://theflatearthsociety.org/forum/index.php?topic=30512.0

*

Parsifal

  • Official Member
  • 36019
  • +0/-0
  • Bendy Light specialist
Re: html help please
« Reply #6 on: September 25, 2008, 12:10:16 PM »
You might be able to do it with setting up certain frames, but as far as I've ever seen, I don't think you can do it straight up with HTML alone. You'll have to look into PHP or JS like something Kappa posted.

I don't think PHP will do much good if it's a dynamic page he wants. PHP is a server-side language.
I'm going to side with the white supremacists.

*

divito the truthist

  • The Elder Ones
  • 6901
  • +0/-0
  • Relativist, Existentialist, Nihilist
Re: html help please
« Reply #7 on: September 25, 2008, 12:54:24 PM »
I don't think PHP will do much good if it's a dynamic page he wants. PHP is a server-side language.

Er...???? The hell are you talking about?
Our existentialist, relativist, nihilist, determinist, fascist, eugenicist moderator hath returned.
Quote from: Fortuna
objectively good

*

Parsifal

  • Official Member
  • 36019
  • +0/-0
  • Bendy Light specialist
Re: html help please
« Reply #8 on: September 25, 2008, 12:55:33 PM »
He wants a menu to appear on a webpage if a person selects a particular option. That can only be done through client-side scripting.
I'm going to side with the white supremacists.

?

spacemanjones

  • 281
  • +0/-0
  • Magic pushes earth
Re: html help please
« Reply #9 on: September 25, 2008, 11:15:31 PM »
This could be one way of many...

Code: [Select]
<script type="text/javascript">
function expand_collapse(obj,list_name){
document.getElementById(list_name).style.display = (obj.checked)? 'block':'none';
}
</script>


<form>

<p>
Check One:<input type="checkbox" onclick="expand_collapse(this,'list1');" checked="checked">
<div id="list1" style="display:block;">
Revealed...
</div>
</p>

<p>
Check One:<input type="checkbox" onclick="expand_collapse(this,'list2');">
<div id="list2" style="display:none;">
Not Revealed...
</div>
</p>

</form>


This is perfect; this is exactly what I was looking for. I was able to change stuff around and get exactly what I wanted.

 I hate to ask another question but is there anyway to in the end have a “save” button that would save it in a text doc or on an excel worksheet in a specified format?

Once again thanks alot!!!


*

Parsifal

  • Official Member
  • 36019
  • +0/-0
  • Bendy Light specialist
Re: html help please
« Reply #10 on: September 25, 2008, 11:23:26 PM »
This is perfect; this is exactly what I was looking for. I was able to change stuff around and get exactly what I wanted.

 I hate to ask another question but is there anyway to in the end have a “save” button that would save it in a text doc or on an excel worksheet in a specified format?

Once again thanks alot!!!

There is, I think. The best way to do it would depend on exactly how the form data is being processed.
I'm going to side with the white supremacists.

*

MadDogX

  • 735
  • +0/-0
  • Resistor is fubar!
Re: html help please
« Reply #11 on: September 25, 2008, 11:47:48 PM »
You won't be able to save such a document straight from the browser, but once you've submitted the form to wherever it is processed, you can basically do whatever you want with the data.
Quote from: Professor Gaypenguin
I want an Orion slave woman :(
Okay, I admit it.  The earth isn't flat.

?

spacemanjones

  • 281
  • +0/-0
  • Magic pushes earth
Re: html help please
« Reply #12 on: September 25, 2008, 11:48:42 PM »
There will be areas where i have to add text boxes for values that will be entered. those text boxes i would like to save... any for that could be printed at a later date would be great.

?

spacemanjones

  • 281
  • +0/-0
  • Magic pushes earth
Re: html help please
« Reply #13 on: September 25, 2008, 11:50:16 PM »
You won't be able to save such a document straight from the browser, but once you've submitted the form to wherever it is processed, you can basically do whatever you want with the data.

Actually now that i think about it... i think i could create an excell macro that will grab the data and format it how i want it... seems to be the long way, but it would work.

*

MadDogX

  • 735
  • +0/-0
  • Resistor is fubar!
Re: html help please
« Reply #14 on: September 26, 2008, 12:05:28 AM »
You won't be able to save such a document straight from the browser, but once you've submitted the form to wherever it is processed, you can basically do whatever you want with the data.

Actually now that i think about it... i think i could create an excell macro that will grab the data and format it how i want it... seems to be the long way, but it would work.


It's a workaround, but I guess you could do that. If you were to send that data to a PHP script for example, you could do all kinds of stuff fairly easily - but if you haven't got an Apache server or similar you won't be able to do that.
Quote from: Professor Gaypenguin
I want an Orion slave woman :(
Okay, I admit it.  The earth isn't flat.

?

spacemanjones

  • 281
  • +0/-0
  • Magic pushes earth
Re: html help please
« Reply #15 on: September 26, 2008, 12:31:03 AM »
You won't be able to save such a document straight from the browser, but once you've submitted the form to wherever it is processed, you can basically do whatever you want with the data.

Actually now that i think about it... i think i could create an excell macro that will grab the data and format it how i want it... seems to be the long way, but it would work.


It's a workaround, but I guess you could do that. If you were to send that data to a PHP script for example, you could do all kinds of stuff fairly easily - but if you haven't got an Apache server or similar you won't be able to do that.

I am in the AF... I always hear about the "oracle server". But odds are they will not let me near it =(. I will just be saving the data in a file on one of our drives.

?

MrKappa

  • 448
  • +0/-0
  • Math abstracts reality... it does not create it...
Re: html help please
« Reply #16 on: September 26, 2008, 12:37:12 AM »
Actually now that i think about it... i think i could create an excell macro that will grab the data and format it how i want it... seems to be the long way, but it would work.

Typically you want to avoid Word Docs... Excel is a different issue...

Try copy pasting this into a plain text file, save it to your desktop with the file extention.... .csv and it should open up just fine...


"AA","BB","CC","DD","EE","FF",
"A1","B1","C1","D1","E1","F1",
"A2","B2","C2","D2","E2","F2",
"A3","B3","C3","D3","E3","F3",
"A4","B4","C4","D4","E4","F4",
"A5","B5","C5","D5","E5","F5",
"A6","B6","C6","D6","E6","F6",




Comma Separated Value is pretty easy to work with... but some programs have a hard time making this format compatible from one program to the next due tot he way they leave out Quotes or use tabs instead of commas as the separator...

Anything fancy will require server side scripting to pre-format the text on it's way from server to the clients web-browser...

Php has built in CSV functions...

http://ca.php.net/manual/en/function.fgetcsv.php
http://ca.php.net/manual/en/function.fputcsv.php

You might want a database to store that data as well if your not comfortable working with the file system alone... MySql is fairly popular and comes with most Linux hosts...






*

Parsifal

  • Official Member
  • 36019
  • +0/-0
  • Bendy Light specialist
Re: html help please
« Reply #17 on: September 26, 2008, 12:45:12 AM »
I don't know if Javascript is capable of writing to files. If so, that's probably the best solution.
I'm going to side with the white supremacists.

*

MadDogX

  • 735
  • +0/-0
  • Resistor is fubar!
Re: html help please
« Reply #18 on: September 26, 2008, 01:29:09 AM »
I don't know if Javascript is capable of writing to files. If so, that's probably the best solution.


Generally not from within a browser. Otherwise websites could easily write malicious files to clients.
Quote from: Professor Gaypenguin
I want an Orion slave woman :(
Okay, I admit it.  The earth isn't flat.

*

Parsifal

  • Official Member
  • 36019
  • +0/-0
  • Bendy Light specialist
Re: html help please
« Reply #19 on: September 26, 2008, 01:50:01 AM »
There's always the option of having it write out the data to a textarea field and then copy it manually into a file.
I'm going to side with the white supremacists.