Webform problem
September 15, 2007 1:53 PM   RSS feed for this thread 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 (5 comments 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


Like Rhomboid says, anything you do in JavaScript will be simply to make things obvious for the viewer, the real calculations are going to be done on the server. You're not interested in hiring somebody, but it might not be a bad idea to pay somebody off craigslist (or mefi jobs!, or me!) a couple hundred bucks to throw together a working solution for you. Copy-and-paste web development usually ends in tears and ruined lives.
posted by floam at 3:36 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


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 Without warning, my laptop sud...   |   Torontofilter: Nice chill yet... Newer »

You are not logged in, either login or create an account to post comments



Related Questions
See me, field me April 19, 2008
My Multi Select UI Sucks. Help me make it better January 7, 2007
Your favorite web design tricks? March 16, 2006
Why the blazes won't this display correctly in... December 13, 2005
Show and Hide DIV Layers May 12, 2005