Connect with Facebook Lost Password?


Go Back   CodeCall Programming Forum > Web Development Forum > HTML Programming

HTML Programming Forum discussion covering HTML, XHTML, DHTML and all flavors of HTML. Hypertext Markup Language is used to create websites.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-21-2008, 04:19 AM
Newbie
 
Join Date: Nov 2008
Posts: 4
Rep Power: 0
Joeyeti is an unknown quantity at this point
Default Two questions regarding <select> data manipulation

Hi all programmers,

I am creating a simple webpage with an image in the background and multiple comboboxes (<select> tag) for the user to select values. Here is one of the comboboxes:

Code:
<select style="position:absolute; left:919px; top:288px; background-color: blue; color: white;" id="cze us" class="us">
<option selected>0 <option>1 <option>2 <option>3 <option>4 <option>5 <option>6 <option>7 <option>8 <option>9 <option>10 <option>11
</select>
I need to work with these selected values further and as I am quite a noob in HTML/Web programming, I have these questions:


1. How could I add values in multiple comboboxes selected, e.g. 1,3,2,6,0 together to a sum value with a button click?

2. Or would it be possible to make the addition interactive - e.g. once the user selects a different value in a combobox, the sum would be adjusted?

3. How could I store the current selections in multiple comboboxes in a txt file on the server and then recall it later?

Thx!

Joe
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 11-21-2008, 11:18 AM
WingedPanther's Avatar   
Super Moderator
 
Join Date: Jul 2006
Age: 36
Posts: 8,079
Blog Entries: 48
Rep Power: 20
WingedPanther is a splendid one to beholdWingedPanther is a splendid one to beholdWingedPanther is a splendid one to beholdWingedPanther is a splendid one to beholdWingedPanther is a splendid one to beholdWingedPanther is a splendid one to beholdWingedPanther is a splendid one to beholdWingedPanther is a splendid one to behold
Default Re: Two questions regarding <select> data manipulation

Your code should really look more like this:
Code:
<select style="position:absolute; left:919px; top:288px; background-color: blue; color: white;" id="cze us" class="us">
  <option selected value="0">0</option>
  <option value="1">1</option>
  <option value="2">2</option>
  <option value="3">3</option>
  <option value="4">4</option>
  <option value="5">5</option>
  <option value="6">6</option>
  <option value="7">7</option>
  <option value="8">8</option>
  <option value="9">9</option>
  <option value="10">10</option>
  <option value="11">11</option>
</select>
Most of what you are talking about requires either JavaScript or server-side scripting.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

Last edited by WingedPanther; 11-21-2008 at 11:20 AM.. Reason: formatting
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 11-21-2008, 12:50 PM
Xav's Avatar   
Xav Xav is offline
Code Slinger
 
Join Date: Mar 2008
Location: The North Pole
Posts: 13,210
Blog Entries: 13
Rep Power: 105
Xav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud of
Send a message via MSN to Xav
Default Re: Two questions regarding <select> data manipulation

If you can use PHP then you could automate the process of generating options:

PHP Code:
<select style="position:absolute; left:919px; top:288px; background-color: blue; color: white;" id="cze us" class="us">
<?php
for ($i 0$i <= 11$i++)
{
  echo 
"<option selected value=\"$i\">$i</option>";

}
?>
</select>
__________________

Quote:
Originally Posted by Jordan View Post
Good members, like yourself, stick around and post for ages to come!
Mr. Xav | Blog | Forums
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 11-21-2008, 01:29 PM
Newbie
 
Join Date: Nov 2008
Posts: 4
Rep Power: 0
Joeyeti is an unknown quantity at this point
Default Re: Two questions regarding <select> data manipulation

Thx guys,

could this then perhaps be moved to the PHP section to fit?
I would be interested in a PHP solution for the addition of the dropdown boxes...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 11-21-2008, 01:34 PM
Xav's Avatar   
Xav Xav is offline
Code Slinger
 
Join Date: Mar 2008
Location: The North Pole
Posts: 13,210
Blog Entries: 13
Rep Power: 105
Xav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud of
Send a message via MSN to Xav
Default Re: Two questions regarding <select> data manipulation

If you want the items to be added without reloading the page, then you need to use JavaScript.

My code above was just to add the items when the user opens the page.
__________________

Quote:
Originally Posted by Jordan View Post
Good members, like yourself, stick around and post for ages to come!
Mr. Xav | Blog | Forums
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Choosing the right language / data structure / Interface ups General Programming 1 09-20-2008 09:11 AM
C#:Tutorial - Download Data Xav CSharp Tutorials 9 04-23-2008 03:18 PM
Java:Tutorial - Data Types John Java Tutorials 6 07-02-2007 09:16 PM


All times are GMT -5. The time now is 08:21 PM.

Freelance Jobs

XML/XSL: Need code for Book with Chapers using XML
Create an XML file for a book of your creation, and a basic CSS file that will format it to display ...
Earn: $40.00


C++/C: Simple firework cue sequencer
What I require is a rework of a simple cue sequencer. I have a piece of hardware (an Arduino boar...
Earn: $50.00


HTML/XHTML: Menu Rework - ASCIIBin
I'm placing this in the HTML/XHTML section of the Freelance site but you are not limited to HTML. Wh...
Earn: $20.00



CodeCall Goal

Goal #1: 1,000 Blogs
Goal #2: 1,000 Wiki Pages
Goal #3: 300,000 Posts
Goal #4: 20,000 Threads
Done: 30%, 23%, 55%, 75%

Ads