Webform problem
September 15, 2007 1:53 PM   Subscribe

Advice on how to set up a webpage that has a dynamic form.

I have a business idea which I'm going to start off as a free service to begin with and then hope that I get enough interest to begin charging for my services. The idea requires a website which has a basic form, probably some JavaScript, and maybe a blog function where people can discuss what is posted.

I think I'll be fine with the blog setup, but I need to figure out how to create a form that has a text box where the number of characters in that text box and a fee based on the number of characters is displayed. I'll probably charge $1 for the first 200 characters, then an extra $1 for every 200 characters after that. So, for example, if a person enters 134 characters they'll be charged $1. If they enter 820 characters they'll be charged $10 etc etc.

What would I need to do to create such a form? I'd prefer not to have to pay a webdesign company to put the webpage together.

I did manage to find a free JavaScript page that can do the character count function, but I wouldn't have a clue how to code the other box which works out the fee based on the number of characters.

This is the JavaScript character counter, and this is an extremely rough picture of how I'd like the form to look.

(of course there'll be a couple of other boxes asking for names and email addresses)

Your help would be much appreciated!
posted by Jase_B to Computers & Internet (4 answers total) 1 user marked this as a favorite
 
I ask a question about building forms recently. Some of the answers may help you.
posted by Brandon Blatcher at 1:59 PM on September 15, 2007


Note that while you can do the fee calculation in javascript for ease of display, you must ultimately do the fee calculation in a server side script for any serious calculation. Otherwise, a user could simply plug in any fee amount they wanted. Javascript runs on the client machine and can trivially be altered/tampered/defeated.
posted by Rhomboid at 3:14 PM on September 15, 2007


That doesn't sound dynamic as much as having some kind of function to submit the number of characters in the text box with the body of the request. Do a server-side calc of the price and refresh the page with the price.
posted by rhizome at 5:02 PM on September 15, 2007


Response by poster: Hmm, sounds like it takes a little more than I thought. Thanks for the replies!
posted by Jase_B at 5:07 PM on September 15, 2007


« Older Hopefully not dead yet?   |   Where to go drinking around Chinatown in Toronto? Newer »
This thread is closed to new comments.