ShowDivP2

A function for dynamic form composition from a Select option. Displays a Div from several, which may contain form items, based on a select choice; with a common second Div to all selections. Used here with ShowSub which shows the submit box after user checks input. Additionally there is a required hidden input value set in the function to a string based on the Select value.




Over 2000+ free Javascript
at JavaScriptBank.com Website

Sampled by JavaScriptBank.com
Static part of form:

Select which category:

Dynamic part of Form:

Function ShowDivP2(SelId,DivId,P2Id,ReqVal) where:

SelId is the Select id in quotes
DivId is the target root div id in quotes
P2Id is the target Common div id in quotes
ReqVal is required value id to be set in quotes

Function ShowSub(SSelId,SDivId) where:

SSelId is the Select id in quotes
SDivId is the target div id in quotes
A select value of 1 shows the div, 0 turns it off.
-----------------

Another small but powerful function by Ira.