Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

ASP Update Question

LEGEND ,
Jan 23, 2007 Jan 23, 2007

Copy link to clipboard

Copied

Hi

I have an ASP update page where i can update my database with values from
text fields.

In my form i have fields for listprice, price, percentage and savings.

I have set a variable called 'discount' which calculates the savings amount
by taking the 'listprice'/100* percentage'
So if i enter say, a percentage of 10 for an item that has a listprice of
£100, the amount in the 'discount variable is 10.

<% dim discount
discount = Request("listprice")/100*(Request("percentage")
%>

when i enter a percentage and submit, the database is updated, but i don't
get the correct values until i submit the form again. I guess this is
because the 'percentage' is worked out from the 'percentage' value already
in the database, hense when i submit the form again, the values are
calculated from the updated 'percentage'.

How can i get the form to re-submit the update form twice. without me having
to do it manually?

Or should i be doing this another way?

Thanks in advacne
Andy


TOPICS
Server side applications

Views

182
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 23, 2007 Jan 23, 2007

Copy link to clipboard

Copied

LATEST
That just means that your database update is happening after you grab your
recordset. Flip-flop the code blocks and you'll be fine; that way the
database is pulling the newly-updated data instead of the old.


"Andy" <andyjhughesNOSPAMTHANKS@ntlworld.com> wrote in message
news:ep5in9$c3n$1@forums.macromedia.com...
> Hi
>
> I have an ASP update page where i can update my database with values from
> text fields.
>
> In my form i have fields for listprice, price, percentage and savings.
>
> I have set a variable called 'discount' which calculates the savings
> amount by taking the 'listprice'/100* percentage'
> So if i enter say, a percentage of 10 for an item that has a listprice of
> £100, the amount in the 'discount variable is 10.
>
> <% dim discount
> discount = Request("listprice")/100*(Request("percentage")
> %>
>
> when i enter a percentage and submit, the database is updated, but i don't
> get the correct values until i submit the form again. I guess this is
> because the 'percentage' is worked out from the 'percentage' value already
> in the database, hense when i submit the form again, the values are
> calculated from the updated 'percentage'.
>
> How can i get the form to re-submit the update form twice. without me
> having to do it manually?
>
> Or should i be doing this another way?
>
> Thanks in advacne
> Andy
>


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines