Form Maker

This is an application that creates a form in HTML depending on user specs


Public

Tested

My Own Work




Online Form Maker

<script>
window.windowname= "Add Form Page"
orpage= window.windowname
function startForm(form) {
nname= form.fname.value;
nname= ((nname== "") ? nname= "" : nname= " NAME=" + nname);
ntarget= form.ftarget.value;
ntarget= ((ntarget== "") ? ntarget= "" : ntarget= " TARGET=" + ntarget);
nenctype= form.fenctype.value;
nenctype= ((nenctype== "") ? nenctype= "" : nenctype= " ENCTYPE=" + nenctype);
whtml= form.HTML.value;
mymethods= form.chosenmethod.selectedIndex;
mymethodsarray= new Array();
mymethodsarray[0] = "";
mymethodsarray[1] = "GET";
mymethodsarray[2] = "POST";
mymethod= mymethodsarray[mymethods];
mymethod= ((mymethod== "") ? mymethod= "" : mymethod= " METHOD=" + mymethod);
myaction= form.chosenaction.value;
myaction= ((myaction== "") ? myaction= "" : myaction= " METHOD=\"" + myaction + "\"");
nhtml= whtml + "\r ";
form.HTML.value = nhtml;
}
function endForm(form) {
whtml= form.HTML.value;
nhtml= whtml + "\r ";
form.HTML.value = nhtml;
}
function newItem(txtarea, form) {
addbre= (form.addbr.checked== true) ? addbre=form.addbr.value : addbre= "";
crows= form.chooserows.value;
ccols= form.choosecols.value;
crows= ((crows== "") ? crows= "" : crows= " ROWS=" + crows);
ccols= ((ccols== "") ? ccols= "" : ccols= " COLS=" + ccols);
ntoit= form.choosevalue.value;
cname= form.choosename.value;
cname= ((cname== "") ? cname= "" : cname= " NAME=\"" + cname + "\"");
ctype= form.choosetype.selectedIndex;
ctypearray= new Array();
ctypearray[0] = "text";
ctypearray[1] = "radio";
ctypearray[2] = "checkbox";
ctypearray[3] = "button";
ctypearray[4] = "hidden";
ctypearray[5] = "reset";
ctypearray[6] = "submit";
ctypearray[7] = "password";
ntoit= ((0 < ctype) ? ntoit= ntoit : ntoit= "");
ntoit= ((ctype > 2) ? ntoit= "" : ntoit= ntoit);
check= form.checks.value
checktf= form.checks.checked
check= ((ctype== 2) | (ctype== 1) ? check= check : check= "")
check= (checktf== true) ? check= check : check= "";
cvalue= form.choosevalue.value;
cvalue= ((cvalue== "") ? cvalue= "" : cvalue= " VALUE=\"" + cvalue + "\"");
csize= form.choosesize.value;
csize= ((ctype== 7) | (ctype== 0) ? csize= csize : csize= "")
csize= ((csize== "") ? csize= "" : csize= " SIZE=" + csize);
clength= form.chooselength.value;
clength= ((clength== "") ? clength= "" : clength= " MAXLENGTH=" + clength);
clength= ((ctype > 0) ? clength="" : clength= clength);
whtml= form.HTML.value;
ctype= " TYPE=\"" + ctypearray[ctype] + "\"";
nhtml= whtml + "\r " + ntoit + addbre;
txtdsply= "Default Text"
nwhtml= whtml + "\r " + txtdsply + "" + addbre;
nhtml= ((txtarea== 8) ? nhtml= nwhtml : nhtml= nhtml);
form.HTML.value = nhtml;
}
function genNewPage(form) {
header= "\r\rGenerated Form\r\r\r";
newhtml= form.HTML.value;
footer= "\r";
newpage= header + "\r\r" + newhtml + "\r\r" + footer;
preWin= open("", "Preview", "width=400,height=400,status=no,toolbar=no,menubar=no");
preWin.document.open();
preWin.document.write(newpage);
preWin.document.close();
}
</script>









FORM MAKER



<table WIDTH="96%" BORDER="0" CELLSPACING="5" CELLPADDING="5">
Make your own feedback form with FormMaker:
FACE="ARIEL,HELVETICA, TIMES NEW ROMAN" SIZE="-1"><form NAME="addform">

Form options:


Name: <input NAME="fname" TYPE="text" size="20">

Action: <input TYPE="text" NAME="chosenaction" size="20">

Method: 

Target: <input NAME="ftarget" TYPE="text" VALUE="code" size="20">

Enctype: <input NAME="fenctype" TYPE="text" size="20">


<input VALUE="Start Form" TYPE="button" NAME="start"
onClick="startForm(document.addform)"> <input VALUE="End Form" TYPE="button" NAME="end"
onClick="endForm(document.addform)">


Description of form item to add:


Type:

Value:<input NAME="choosevalue" TYPE="text" VALUE size="20">

Name:<input NAME="choosename" TYPE="text" VALUE size="20">

Size:<input NAME="choosesize" TYPE="text" VALUE size="20">

Maximum Length:<input NAME="chooselength" TYPE="text" VALUE size="20">

Rows:<input NAME="chooserows" TYPE="text" VALUE size="20">

Columns:<input NAME="choosecols" TYPE="text" VALUE size="20">

<input NAME="addbr" TYPE="checkbox" VALUE="<BR>">Add <BR> tag after form item?

<input NAME="checks" TYPE="checkbox" VALUE=" CHECKED">Is checkbox/radio button checked?


<input VALUE="Add Item" TYPE="button" NAME="additem"
onClick="newItem(document.addform.choosetype.selectedIndex,document.addform)">


HTML:

<textarea NAME="HTML" ROWS="10" COLS="45">


<input VALUE="Reset" TYPE="reset" NAME="reset"> <input VALUE="Preview" TYPE="button"
NAME="preview" onClick="genNewPage(document.addform)">















Views 3903 Downloads 1574

JS+JQuery Layout+Design
JeffSmith
26
Revisions

v1.0