I'm developing a custom app that requires I list items from a database
to a form. The fields would be something like PartNo, Description,
Price,Qty.
I want them to list in a form (Example:)
HUD-9283 CONNECTOR-A 1.00 [ QTY ]
SDD-5483 CONNECTOR-B 2.00 [ QTY ]
DEE-1313 CONNECTOR-C 5.20 [ QTY ]
etc.....
The qty is to be entered by the user (input type=text). The form will
always have
a random amount of items and can be any part number based on the user
query. I need to be able to identify the part where a qty is entered
and be able
to perform a qty * price for that part.
I know a simple solution would be to have the user click on
a part they want, go to another screen where I can use a generic
<input type="text" name="qty">, But, I'm trying to avoid going to
another screen.
Any suggestions or other method I should consider?
Thanks
so when you submit the form you will have three arrays prod_code, price
and qty. Cycle through the arrays using MvWHILE and evaluate only those
lines which have a qty of one or more.
gettoken is an easy way of extracting data from such created arrays
<MvASSIGN NAME="recno" VALUE="1">
<MvWHILE EXPR="{ gettoken(qty,',',recno) }">
<MvEVAL EXPR="{ gettoken(qty,',',recno) * gettoken(price,',',recno) }">
for <MvEVAL EXPR="{ gettoken(prod_code,',',recno) }">
<MvASSIGN NAME="recno" VALUE="{ recno + 1 }">
</MvWHILE>
Hope that helps
Allan
On Fri, 14 Apr 2006 14:51:59 +1200, J-vibe <housemu...@yahoo.com>
wrote:
> __________ NOD32 1.1488 (20060413) Information __________
>
> This message was checked by NOD32 antivirus system.
> http://www.eset.com
>
>
--
----------------------------------------
From Allan James
Get Web Design and Hosting
www.getweb.co.nz
Ph 07 889 3337
Mo 0274 86 56 00
----------------------------------------
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Here is an easy way to do it:
http://www.mivascript.org/test/miva_example.mvc
But you should think a little bit AJAX :) There is many ways to do such
things without stressing the server resources and it's quite simple...
If you need more examples just tell me and I'll try to post something in
this way..
Best regards,
Claudiu Bischoff
> -----Message d'origine-----
> De : miva-...@googlegroups.com [mailto:miva-...@googlegroups.com] De
> la part de Allan James
> Envoyé : vendredi 14 avril 2006 05:43
> À : miva-...@googlegroups.com
> Objet : [miva] Re: Listing Items from Database/Form
best regards,
Claudiu Bischoff
> __________ NOD32 1.1489 (20060414) Information __________
Sorry.. I made it quick and I forgot to test it on Opera. I updated it and
now it's working on Opera too
PS: Don't forget to delete your temporary files :)
Best regards,
Claudiu Bischoff
> -----Message d'origine-----
> De : miva-...@googlegroups.com [mailto:miva-...@googlegroups.com] De
> la part de Allan James
> Envoyé : vendredi 14 avril 2006 15:32
Oh... that's just an old habit I have, using structures (10x 2 Bill :)). You
can use anything instead, but it's simpler to pass dynamic variables like
this. You can use 'prod:prodcode', but if you need to pass more than 1
variable (in our case quantity) I find it more logical to use clear names:
prod:qnt -> talking about quantity, prod:code -> talking about code :)
PS: I'll try to post an example that I use frequently with "pure" AJAX. It's
a little bit different, because we need a framework to make it easy to
program. I'm using Ajax Pages v0.5 and I found it very very easy to
implement (I tried many open-source AJAX frameworks and I found that one
very clean). Here you have a link to see all about it:
http://ajax-pages.sourceforge.net/
Best regards,
Claudiu Bischoff
> -----Message d'origine-----
> De : miva-...@googlegroups.com [mailto:miva-...@googlegroups.com] De
> la part de J-vibe
> Envoyé : samedi 15 avril 2006 18:23
> À : miva-script
> Objet : [miva] Re: Listing Items from Database/Form
>
>