JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 27th, 2013, 06:08 AM
woLkhan woLkhan is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2013
Posts: 6 woLkhan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 32 m 34 sec
Reputation Power: 0
New Member - HTML Active Dropdown List

Hi,

i want to make a dropdown list. The selected option must write on a differerent area of page.

For example:

Code:
<select id="DayOfWeek" name="DayOfWeek">
    <option value="1">Sunday</option>
    <option value="2">Monday</option>
    <option value="3">Tuesday</option>
    <option value="4">Wednesday</option>
    <option value="5">Thursday</option>
    <option value="6">Friday</option>
    <option value="7">Saturday</option>
</select>


If user selects "Monday", "Monday" must be in a sentence.

For example:

Today is Monday and sunny day.

If possible, the user can copy the all sentence. Because i will create a code and user wants to copy the code.

Can anyone help?

Reply With Quote
  #2  
Old February 28th, 2013, 09:33 AM
Strider64 Strider64 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2012
Posts: 28 Strider64 User rank is Corporal (100 - 500 Reputation Level)Strider64 User rank is Corporal (100 - 500 Reputation Level)Strider64 User rank is Corporal (100 - 500 Reputation Level)Strider64 User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Day 1 h 52 m 12 sec
Reputation Power: 0
Couldn't you do something like this?

Code:
<select id="DayOfWeek" name="DayOfWeek">
    <option value="Sunday">Sunday</option>
    <option value="Monday">Monday</option>
    <option value="Tuesday">Tuesday</option>
    <option value="Wednesday">Wednesday</option>
    <option value="Thursday">Thursday</option>
    <option value="FRIDAY">Friday</option>
    <option value="SATURDAY">Saturday</option>
</select>


However, If I am understanding you correctly you want to interject some code into it. I'll use php as a rough example, I'm sure you can do it with JavaScript.

PHP Code:
<select id="DayOfWeek" name="DayOfWeek">
<? 
php 
for ($count=1$count <= $page_count$count++) {
            echo 
"<option value=\"{$count}\"";
            if (
$calendar['day_of_the_week'] == $db_usr_table['count']) { echo " selected"; }
            echo 
">{$count}</option>";
        } 
?>
</select> 


Obviously the code won't work and is somewhat logically impaired, but you could do something like that? Another option would to play around with date formats where it automatically picks the day.

Reply With Quote
  #3  
Old February 28th, 2013, 09:38 AM
woLkhan woLkhan is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2013
Posts: 6 woLkhan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 32 m 34 sec
Reputation Power: 0
Thank you Strider64,

I got my solution with JavaScript few hours ago.

Thanks again.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > New Member - HTML Active Dropdown List

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap