Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: use a value form a manu list in a form on the same page

2 views
Skip to first unread message

Denis McMahon

unread,
May 23, 2013, 8:19:31 PM5/23/13
to
On Mon, 22 Apr 2013 03:40:12 -0700, newbie php wrote:

> I'm so glad you guys helped me out a couple of days ago, so i thought
> i'd had another go.

You did? How did that work out for you.

> Here's the situation: in a form i want a visitor to choose form a list a
> value of 1 to 10.

Yeah, in a form if you want the user to choose a number like that you can
use an html select / option, or a set of radio buttons, or you could use
a text input and let the user enter a number, but they might enter a
number outside your range.

> This chosen value should be multiplied by a value of
> 2750 which should be stored in a variable and shown on the page
> (recalculated by any change in the list)

This sounds more like a javascript thing than a php thing, you probably
don't want to submit your form to the server each time the user changes
their option.

> this value does nog necesarily be in the form itself. The most important
> question is how to put the chosen value in a variable.

Not quite sure what a nog is.

Well you'd use an appropriate javascript function to get the value from
the input type that you were using, making sure that you did any needed
conversions to numeric data if it started life as a string value, and
then do the relevant multiplication and display it in a suitable output
location.

> Any help is greatly appreciated

You're welcome.

xp and fu set, this sounds like primarily a js issue, not a php one

--
Denis McMahon, denismf...@gmail.com

The Natural Philosopher

unread,
May 24, 2013, 5:12:15 AM5/24/13
to
On 24/05/13 01:19, Denis McMahon wrote:
>
> Not quite sure what a nog is.
http://www.nogginthenog.co.uk/


--
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to lead are elected by the least capable of producing, and where the members of society least likely to sustain themselves or succeed, are rewarded with goods and services paid for by the confiscated wealth of a diminishing number of producers.

0 new messages