blenderNetworkpatreonblender-logosdheartuserthtimesbookphotopencilmap-markerchevron-rightbancommentcommentstwitterfacebookrsschainnavicongoogle-plusenvelopelinkedinmail-replycalendar-otumblrredditstumbleuponshare-altbloggerflattrflag

populating a drop down list.

populating a drop down list.

Postby themitchel0 » January 23rd, 2011, 10:09 am

hey guys, do you know how to populate a drop down list in html, and then only show the selected option? thanks themitchel0
themitchel0
Pro
Pro
 
Posts: 365
Joined: June 15th, 2010, 8:31 am

Re: populating a drop down list.

Postby SPARTAN-001 » January 23rd, 2011, 10:22 am

Erm... I used to... :P I don't remember how to now. Sorry.
//SPARTAN
Image
Practice makes perfect and nothing is perfect, so why practice? -brektzar
User avatar
SPARTAN-001
Legend
Legend
 
Posts: 1106
Joined: November 5th, 2008, 4:23 pm

Re: populating a drop down list.

Postby brektzar » January 23rd, 2011, 10:35 am

I also used to know, back when i was in school ^^
But, i forget... I did a google search for it and this might help you out:
http://www.htmlcodetutorial.com/linking ... p_114.html
//Jimmy
Sorry for my english, it is not always the best ;)

If there is anything you need feel free to ask! :)

My gallery
My deviantART account
Image
User avatar
brektzar
Moderator
Moderator
 
Posts: 1328
Joined: November 26th, 2009, 2:28 pm
Location: Sweden

Re: populating a drop down list.

Postby themitchel0 » January 23rd, 2011, 10:53 am

thanks guys, but brektzar, your link isnt working...
themitchel0
Pro
Pro
 
Posts: 365
Joined: June 15th, 2010, 8:31 am

Re: populating a drop down list.

Postby IrascibleOne » January 23rd, 2011, 12:46 pm

A drop-down form is something like this:
Code: Select all
<select name="field_name">
    <option value="">Choose One</option>
    <option value="value1">Choice 1</option>
    <option value="value2" disabled="disabled">Choice 2</option>
    <option value="value3" selected="selected">Choice 3</option>
<select>


The option tag with the selected="selected" attribute will be preselected when the page loads. If you don't have that attribute on any of them, then the first one will be preselected. The disabled="disabled" attribute should turn off that option, so that a user cannot select it. I have never used that before, so I may be wrong in assuming it can work for individual choices as opposed to just the whole drop-down form.

If you want to go much beyond these things, you will need javascript or php depending on what you want to do.
Image
User avatar
IrascibleOne
Site Admin
Site Admin
 
Posts: 1540
Joined: July 31st, 2008, 7:14 pm

Re: populating a drop down list.

Postby themitchel0 » January 23rd, 2011, 1:26 pm

thank you irascrible, but do you know where i could find out about how to go farther with javascript? thanks again
themitchel0
Pro
Pro
 
Posts: 365
Joined: June 15th, 2010, 8:31 am

Re: populating a drop down list.

Postby brektzar » January 23rd, 2011, 1:34 pm

the link i posted worked fine for me :S
//Jimmy
Sorry for my english, it is not always the best ;)

If there is anything you need feel free to ask! :)

My gallery
My deviantART account
Image
User avatar
brektzar
Moderator
Moderator
 
Posts: 1328
Joined: November 26th, 2009, 2:28 pm
Location: Sweden

Re: populating a drop down list.

Postby themitchel0 » January 23rd, 2011, 4:31 pm

whoops brektzar, it working now! sorry.
on another note, does anyone know how to change the size of a fieldset?
themitchel0
Pro
Pro
 
Posts: 365
Joined: June 15th, 2010, 8:31 am

Re: populating a drop down list.

Postby IrascibleOne » January 23rd, 2011, 8:06 pm

do you know where i could find out about how to go farther with javascript?


It really depends on what you want to do. You can try sifting through tutorials at Nettuts. That group of sites tend to have good tutorials on all sorts of things.

As for the fieldset size, if the width and height attributes don't work (I dunno if they do, I haven't used fieldsets in so long) then you can try resizing with CSS.

Code: Select all
<fieldset style="width:200px;height:200px;">
    /*-- Fieldset Contents --*/
</fieldset>


All you'd have to do is change the width and height values to whatever you would like them to be. You could also use percentages in place of the pixel values, if that works better for you.
Image
User avatar
IrascibleOne
Site Admin
Site Admin
 
Posts: 1540
Joined: July 31st, 2008, 7:14 pm

Re: populating a drop down list.

Postby themitchel0 » January 25th, 2011, 12:43 pm

does anyone know how to send an email with javascript? something for a contact form, like the on ds has. or would it be easier to do this with php? thanks!
themitchel0
Pro
Pro
 
Posts: 365
Joined: June 15th, 2010, 8:31 am
Next
Return to Programming

Who is online

Users browsing this forum: No registered users and 2 guests

cron