PDA

View Full Version : How easy is a dynamic web form?


Desmo
30-10-2007, 09:27
OK, I've got most of my form set up, but thought I could add a little feature (although it's not 100% necessary so if it's too much work, I don't NEED it).

I've got a list of say 5 products. Customer type in how many of each they want. Form knows how much each item costs and adds up a total into another field. This field is then sent as part of the data on the web form.

e.g. Customer fills in red fields on form. Form works out blue field. Both red and blue field values are sent with the form.

Product 1 : 2 @ £10
Product 2 : 0 @ £10
Product 3 : 1 @ £15

Total : £35


So, is it easy enough? I don't mind sorting this myself if you can point me in the right direction for a guide :)

leowyatt
30-10-2007, 09:45
bit of javascript should do that no problem :)

ideally I'd make the 10, 10 & 15 readonly and auto populate. Actually how many product fields is the customer going to fill in?

Desmo
30-10-2007, 10:29
Yep, the price fields will be fixed so they can be read only. There will be the following products...

Business Card
Letterhead
Compliment Slip
Stationery Pack
Artwork Level 1
Artwork Level 2
Artwork Level 3

...they will all have their own fixed prices. I just need the customer to type in an amount next to the product required. This will then give a total which, along with the amounts for the products, gets sent in the form.

leowyatt
30-10-2007, 10:44
so there will only ever be 7 rows on the page?

Desmo
30-10-2007, 10:57
At the moment, I think so. Is it difficult to add more at a later date?

leowyatt
30-10-2007, 11:11
nope not at all :)

Desmo
30-10-2007, 11:21
Cool. So where do I go from here? :)

leowyatt
30-10-2007, 11:42
This (http://homepage.ntlworld.com/kayseycarvey/variables3.html) should point you in the right direction :)

Desmo
30-10-2007, 12:37
Fook me. I'm gonna be a week trying to sort all that out ;D

leowyatt
30-10-2007, 12:49
nah you aren't :) honestly it's not a big thing, once you've got your form, you just need to write one function that adds up all the stuff and just make that a onchange call on each text field :)

Desmo
30-10-2007, 12:51
But it also need to multiply each amount before it does the adding up. I'll take a look when I've got time.

leowyatt
30-10-2007, 12:53
fair enough, but don't panic :)

Desmo
30-10-2007, 15:56
Is it cheating to steal code from another web example? If it is, I don't care. I got it working with a bit of fiddling around :D

I've now got some CRM software to handle all accounts. The web form take the customer details and sends them as a lead. All the fields are now automatically completed for me, including order amount and values. This is then auto added to an email template with a paypal link. SORTED!!! It's automated a lot of the stuff for me :D

LeperousDust
31-10-2007, 02:59
Can i have a nose? Sounds like your really making progress :)

Desmo
31-10-2007, 08:30
It's not as great as it sounds ;D

The site is fairly plain overall but this automation is a real time saver for me. The details from the form are put into SugarCRM (www.sugarcrm.com). I'm using the opensource version. This allows me to track all the orders, keep customer details, upload their files and artworks and put all of their details and attachment into professional looking emails. It's really good. I was going to start giving out details to a few people to give it a bit of a test anyway so will give you, and others, a shout soon :)

LeperousDust
31-10-2007, 18:19
Excellent, i don't mind testing :) As i said now i've had a peep looks really good, as you say plain, but that doesn't mean bad. Just means easy and quick to understand read and easy on the eye. Thats why i want anyway!

Desmo
31-10-2007, 18:54
Did stuff work and look OK in that funny browser you use? ;D

When I'm set, I'll make a new thread in GD with some proper testing and feedback going on.

LeperousDust
01-11-2007, 22:42
Yes! That actually impressed me, everything works wonderfully in Opera which a lot of more "experienced" programmers seem to fail at. Everything i clicked worked, i didnt noticed spelling errors (but i wasn't really looking tbh). I'll have a good go at testing for you when i get the time :)

Desmo
01-11-2007, 22:58
Like I said, feel free to fill in and send off the orderform if you want to, I can dump all the info before going live :)