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:
I need to work with these selected values further and as I am quite a noob in HTML/Web programming, I have these questions: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>
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
Your code should really look more like this:
Most of what you are talking about requires either JavaScript or server-side scripting.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>
Last edited by WingedPanther; 11-21-2008 at 09:20 AM. Reason: formatting
If you can use PHP then you could automate the process of generating options:
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>
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...
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks