Insert Form Fields On Demand | JavaScriptSource

Insert Form Fields On Demand

JavaScriptSource Staff Nov 5, 2008

General

This script will provide additional fields in a form, as needed, on demand. Any number of fields can be added. Easy to customize and implement.


Name:
Email:
List gifts, one per field.
[ add more gifts ]

Notes

For additional details and usage, visit the author's Web site.

Source Code

Paste this source code into the designated areas.

External file

Paste this code into an external JavaScript file named: insertOnDemand.js


Head

Paste this code into the HEAD section of your HTML document.


Body

Paste this code into the BODY section of your HTML document


Leave a Response

(7 comments)

Works great except how do you dynamically create a matching number of fields in your database. If you have to add them to begin with, what do you name them? gifts1, gifts2, etc?

mystic7 Aug 10, 2012

Thanks for the heads up, John. It's working now.

Lee Jan 16, 2009

Your question is beyond the scope of these comments. You will need to post it over on [a href="http://www.webdeveloper.com/forum/forumdisplay.php?f=3"]the JavaScript forum[/a]. Thanks!

Lee Jan 16, 2009

I get an error when I try to send this script![br /][br /]ERROR: Script insert-form-fields-on-demand.html is missing at /www2/jss/cgi-bin/scriptbot2.cgi line 53.[br /][br /]Obviously I can paste it in myself but I thought you would like to know.[br /][br /]Kubuntu 8.04 LTS/Mozilla Firefox 3.0.4

John Dec 4, 2008

There doesn't seem to be must explination on how to edit certain parts to customize the form.[br /][br /]I know virtually nothing about javascript and this was a god send for me, but unfortunately, it doesn't fit exactly how I would like it. So I've tried chaning a few things and now the darn thing doesn't work anymore.[br /][br /]So a bit of explination on how or what you can change to make it still function when customization is needed.

Husky Dec 2, 2008