Jump to content

Archived

This topic is now archived and is closed to further replies.

web2000

List Box Mutiplying on another value

Recommended Posts

Hello,

I have a listbox that is part of a submit form.

I want this listbox to display values that are multiplied from another field in the URL.

So...Basically when the page loads a parameter called 'nocase' has a value in the url, something like 6, 12, etc

Say for instance the nocase parameter in the URL is '4' i want the list box to put 4, 8, 12, 16, 20, 24,

And if the nocase URL parameter is 12, i want the listbox to display 12, 24, 36, 48, 60, 72, etc

Please help...and stuck

Regards

Share this post


Link to post
Share on other sites
[code]

<select name="list">
<?php
$nocase = $_GET['nocase'];
for($i=2;$i<10;$i++) {
   echo "<option value='".($nocase*$i)."'>".($nocase*$i)."</option>";
}
?>
</select>

[/code]

the code is not tested, but shud work

hth

Share this post


Link to post
Share on other sites
Hi,

Do you know how i can also get the nocase in the list as well?

Like at the moment if its 2, it will put 4, 6, 8, 10, 12 etc

Anyway to get it 2, 4, 6 etc

Regards

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.