|
|
#1 |
|
Dont do that...
Join Date: Jun 2007
Location: Alberta, Canada
Posts: 3,928
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Who knows how to HTML?
Hello,
I need to make something. Basically what I want to do is have a bunch of fields with drop down menus. For example: the first field is a year going from present back to whenever. Someone selects a year from a drop down list and then in the next drop down list they select a make of car. for example, Toyota. Then there is another field, for the model of car, for example corolla. And then another one for car options, for example 2 door or 4 door etc. Once you have filled them out you will automatically be taken to a page that gives you information about that year, make, and model of car. I have no idea how to code this. Help! If you can show me what code I need that would be amazing! Or if you know of a resource that can show me how to do it that would rock as well. Thanks!
__________________
life can evolve without begetting plants or birds or cuddly mammals or sentient beings who write blogs on the internet; it just begets a glob of ooze. |
|
|
|
|
|
#2 |
|
...
Join Date: Feb 2008
Posts: 3,029
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
You are going to need some server side scripting and some sort of database to achieve that. Your best bet is to learn a little bit of php.
If you look for tutorials on populating a drop down list from a database, most will show how to make them link together as you suggest. Essentially what it would be doing is querying a list of models based on the selected make ID of the first box. So when you select Toyota lets say it has a ID value of 10 in a database table of called "makes", the model drop down box will perform a query which in layman's terms will say "select all the models in the models table that have the make ID of 10". I will find a few tutorials in a moment. Edit: How dynamic are you wanting this, are you happy with the page reloading when a drop down is selected (should be a super quick reload if you keep the page light) or do you want it to all be done without any page reloads. If you want the latter, you will need to use ajax requests and possibly jQuery? Edit 100000: I have removed the link to the original example because it is pretty terrible, and not worth looking at. I will write something quickly tomorrow I will be more of a help tomorrow, I am just off to bed now so don't want to get into any coding
__________________
Last edited by Matticus; 27th Jun 2012 at 23:17. |
|
|
|
|
|
#3 |
|
Dont do that...
Join Date: Jun 2007
Location: Alberta, Canada
Posts: 3,928
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
awesome! thank you!
__________________
life can evolve without begetting plants or birds or cuddly mammals or sentient beings who write blogs on the internet; it just begets a glob of ooze. |
|
|
|
|
|
#4 |
|
How many wifi's does it have?
Join Date: Jan 2007
Location: Montreal, Canada
Posts: 11,651
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Here are some really good tutorial sites:
-> http://www.w3schools.com/html/html_forms.asp (direct link to the HTML Forms tutorial) -> PHP tutorial: http://www.w3schools.com/php/default.asp PHP is a language that you merge with HTML page. well actually the contrary... you have a .php file, and you have HTML code inside. Here are things that you can do with PHP: Code:
<?php
// This is my PHP part
echo "Hello! I am outputing some <b>HTML</b>. The web browser source code will not see code but the message, with 'HTML' marked in bold, as if I did it in HTML, as it is code compiled on the server automicaly. I don't have have to do anything beside sending my php page(s) to my server, the same way I do my HTML pages!<br/><br/>"
// end of PHP
?>
Hello again!, This is my HTML part. Anything here is in HTML format.<br/><br/>
<?php
$myVar = true;
if ($myVar == true) {
echo "Amazing! I am back in HTML, but outputting on the page, using 'echo' HTML code. BTW, that value for myVar is ".$myVar.". Truly interesting fact!";
} else{
echo "Double amazing! I am back in HTML, but outputting on the page, using 'echo' HTML code. BTW, that value for myVar is ".$myVar.". Yup it's false!";
}
?>
Here is the thing. PHP is code compiled on the server.. so if you load the PHP page in your web browser.. well, you'll see your page as if you opened it in Notepad... practically, and not what you wanted. It needs to be compiled. TO do this, you need to make your computer a server. As much scary as it sounds, it's rather easy.. especially that it's an offline server... so you have nothing to worry about. You can use Microsoft WebMatrix 2, a real nice coding software for web pages. Easy to use, and it comes built-in server. All you have to do, is hit the "Run" button on the ribbon bar of the program, and poof! Your see your PHP (or HTML) as if it was uploaded on your server. It also debug your code as code it. HTML, CSS, and PHP. Microosft Webmatrix is 100% free, and you can do commercial content with it. http://www.microsoft.com/web/webmatrix/ You can also publish your website to your own server form the program. The program will see what has changed, what files has been added (very smart system, btw), and uploads these files your web server, and now everyone can see it.
__________________
Nv GPU Pro - Automate your graphic card overclock base on what you run, reduce power and noise. Designed for Laptops and Desktops. Filled with features. Core i7 930 2.8GHz | G.Skill Pi 6GB 1600MHz 7-5-7-24 1.5V | Gigabyte GA-X58A-UD5 | GeForce GTX 260 | W.D Caviar Black 1TB | Corsair AX750 | Noctua NH-U12P | Xonar Essence STX | Win8 Pro 64-bit | Dell U2410 - 1920x1200 | OCZ Vertex 4 250GB |
|
|
|
|
|
#5 |
|
1338-One step infront of the pro's
Join Date: May 2008
Location: London
Posts: 804
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
You can also use WAMP which will run your PHP. Not sure of the differences between microsofts offering and wamp though
__________________
aLtikal's Rig... | Antec P182 | Q6700 @ 3.1Ghz| Abit AB9 Pro | 5770 1Gb Vapor-X | 4GB 800mhz Geil BlackDragon 4-4-4-12 | XtremeMusic | Z-5500's | MX-518| Samsung 2232bw 2ms 1680x1050| Builder & Customizer of 11 PC's
|
|
|
|
|
|
#6 |
|
Mega mom
Join Date: May 2010
Posts: 1,390
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
What size is the total dataset? How many cars?
I'd wager it's not a huge list and in plain text comparable to a reasonable sized image. So rather than go with an active scripting solution (PHP, .NET etc) and AJAX just look at a 100% javaScript solution. Embed all the options in an array and code up a cascading list of selects. http://www.tek-tips.com/faqs.cfm?fid=6294 http://www.javascriptkit.com/javatut...content2.shtml If your dataset is too large to load at once, then look at basic AJAX techniques to load a select list from an external file. (Tip = Look at .innerHTML). If your list of cars etc isn't going to be in a database you can dispense with PHP etc and use 100% javaScript and plain text (HTML) files to load on demand. It's a bit clunky, but no more than using PHP for nothing more than an "If - else" or big-ol' switch statement. |
|
|
|
|
|
#7 | |
|
How many wifi's does it have?
Join Date: Jan 2007
Location: Montreal, Canada
Posts: 11,651
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Quote:
Microsoft solution is fast, light and doesn't slow your Windows startup.
__________________
Nv GPU Pro - Automate your graphic card overclock base on what you run, reduce power and noise. Designed for Laptops and Desktops. Filled with features. Core i7 930 2.8GHz | G.Skill Pi 6GB 1600MHz 7-5-7-24 1.5V | Gigabyte GA-X58A-UD5 | GeForce GTX 260 | W.D Caviar Black 1TB | Corsair AX750 | Noctua NH-U12P | Xonar Essence STX | Win8 Pro 64-bit | Dell U2410 - 1920x1200 | OCZ Vertex 4 250GB |
|
|
|
|
|
|
#8 |
|
Dont do that...
Join Date: Jun 2007
Location: Alberta, Canada
Posts: 3,928
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
oy, way over my head. I was hoping this would be sort of easy.
Years going from present back to 2000 and in some cases back to 1990 All makes of cars (except for some of the exotic stuff) All models of cars. All options for cars. And pictures, not just text. In other words, this is massive. Currently we have a book(in a three inch binder that is over full) for this but as we are moving to tablets I want to get this information into the tablet. And make it as easy as possible for people to look up. Am I going about this the right way or can you suggest something else? Maybe just links so a page that starts with all the years click on a year and it takes you to a page for all the makes and so on. would be a lot of work but it's simple work and I would just need a reminder of basic html instead of learning something new.
__________________
life can evolve without begetting plants or birds or cuddly mammals or sentient beings who write blogs on the internet; it just begets a glob of ooze. |
|
|
|
|
|
#9 |
|
Supermodder
Join Date: Nov 2010
Posts: 297
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Code:
<form> <select name="year"> <option value="1991">1991</option> <option value="1992">1992</option> <option value="1993">1992</option> <!-- REPEAT OPTIONS AS MANY TIMES AS REQUIRED, EACH WITH THE UNIQUE VALUE AND TEXT --> </select> <select name="Make"> <option value="Toyota">Toyota</option> <option value="Ford">Ford</option> <option value="Another">Another/option> <!-- REPEAT OPTIONS AS MANY TIMES AS REQUIRED, EACH WITH THE UNIQUE VALUE AND TEXT --> </select> <select name="Model"> <option value="KA">KA</option> <option value="SCAMOBILE">SCAMOBILE</option> <option value="ANYTHING">ANYTHING</option> <!-- REPEAT OPTIONS AS MANY TIMES AS REQUIRED, EACH WITH THE UNIQUE VALUE AND TEXT --> </select> </form> EDIT: It's also worth mentioning that HTML deals with the layout of websites, and not with dynamic tasks like you want. You really need to learn either a server side scripting language (like PHP) or you could do it with jquery (but that would be the messy way). |
|
|
|
|
|
#10 |
|
How many wifi's does it have?
Join Date: Jan 2007
Location: Montreal, Canada
Posts: 11,651
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Agreed.
I recommend for your database MySQL, which most web server have already installed and support. There is also a workbench software for MySQL (free), so that you can create and edit your database visually directly from your web server. Download here: http://www.mysql.com/products/workbench/
__________________
Nv GPU Pro - Automate your graphic card overclock base on what you run, reduce power and noise. Designed for Laptops and Desktops. Filled with features. Core i7 930 2.8GHz | G.Skill Pi 6GB 1600MHz 7-5-7-24 1.5V | Gigabyte GA-X58A-UD5 | GeForce GTX 260 | W.D Caviar Black 1TB | Corsair AX750 | Noctua NH-U12P | Xonar Essence STX | Win8 Pro 64-bit | Dell U2410 - 1920x1200 | OCZ Vertex 4 250GB |
|
|
|
|
|
#11 |
|
I *am* a Dremel
Join Date: Oct 2009
Posts: 1,998
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
I would recommend the PHP/MySQL solution to be honest. You will want the page to load as fast as possible with the iPad especially if it is on 3G or something similar.
|
|
|
|
|
|
#12 |
|
...
Join Date: Feb 2008
Posts: 3,029
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Oops completely forgot about this, I will get something together over the weekend, I have been doing PHP and MySQL all week so understandably I am in no rush to do more
__________________
|
|
|
|
|
|
#13 |
|
Dont do that...
Join Date: Jun 2007
Location: Alberta, Canada
Posts: 3,928
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
No worries, I've been putting together all the info. Last night I looked into how large the current files are. Everything in power point presentations and take 1.5gb of information.
Makes me wonder if I should scan from paper or take screen shots of each slide... This is going to take me a while...
__________________
life can evolve without begetting plants or birds or cuddly mammals or sentient beings who write blogs on the internet; it just begets a glob of ooze. |
|
|
|
|
|
#14 |
|
Dont do that...
Join Date: Jun 2007
Location: Alberta, Canada
Posts: 3,928
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
I currently have two years worth of car folders made. And I have made over 1000 folders. only 15 more years to go....
I might cry.
__________________
life can evolve without begetting plants or birds or cuddly mammals or sentient beings who write blogs on the internet; it just begets a glob of ooze. |
|
|
|
|
|
#15 |
|
Multimodder
Join Date: Sep 2010
Posts: 110
![]() |
perhaps a content management system e.g. drupal, joomla, etc.
__________________
Asus M4A79XTD EVO, Corsair VX550, Phenom x2 555 BE (x4 B55 3 cores), Corsair Memory XMS3 4GB (2 x 2GB) DDR3 PC3-12800 C9 1600MHz, Sapphire HD5770, Samsung 1 Tb F3 |
|
|
|
|
|
#16 |
|
Dont do that...
Join Date: Jun 2007
Location: Alberta, Canada
Posts: 3,928
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
I don't understand, what is that?
__________________
life can evolve without begetting plants or birds or cuddly mammals or sentient beings who write blogs on the internet; it just begets a glob of ooze. |
|
|
|
|
|
#17 |
|
System Support Specialist
Join Date: Apr 2010
Location: United Kingdom
Posts: 1,250
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
__________________
If someone has helped you remember to + Rep them (: |
|
|
|
|
|
#18 |
|
Dont do that...
Join Date: Jun 2007
Location: Alberta, Canada
Posts: 3,928
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
I don't understand how that would save me any time. I still have to create a few thousand more folders. writing the html is pretty quick and easy. Copy and paste. How would a program like that save me any time?
__________________
life can evolve without begetting plants or birds or cuddly mammals or sentient beings who write blogs on the internet; it just begets a glob of ooze. |
|
|
|
|
|
#19 |
|
's custom title is teh srs bizznizz
Join Date: Jul 2009
Location: Cambridge, UK
Posts: 861
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Basic, it's 3am.
Code:
create database web_cars; use web_cars; CREATE TABLE cars ( carid int auto_increment primary key, /*ID of car, going up */ year varchar(20), /*1981,1982,1983 etc etc */ make varchar(20), /* Toyota, Ford, Ferrari etc etc*/ carmodel varchar(50), caroptions varchar(50), /* 2door,4door*/ extra varchar(50) /* Type of car? Sports, estate or something of the like */ ); |
|
|
|
|
|
#20 |
|
Multimodder
Join Date: Sep 2010
Posts: 110
![]() |
If you are going to catalogue that much information, it would be a shame not to store it in a readily accessible format - a (mysql) database. Basically all you need to do is to create a database, write the form to do the data entry, then you can decide afterwards how you want your site to look. You can usually accomplish what I said in a few clicks using a CMS.
__________________
Asus M4A79XTD EVO, Corsair VX550, Phenom x2 555 BE (x4 B55 3 cores), Corsair Memory XMS3 4GB (2 x 2GB) DDR3 PC3-12800 C9 1600MHz, Sapphire HD5770, Samsung 1 Tb F3 |
|
|
|
![]() |
| Thread Tools | |
|
|