rendered paste body<html>
<head>
<title>Dude, Where is my car?</title>
<body>
<form>
<input type="button" onclick="AddRatingBox()" value="Call function">
</form>
<script type="text/javascript">
items = new Array();
var begin = '\
<form>\
<input type="button" onclick="AddScale()" value="Add scale">\
<input type="button" onclick="AddCheck()" value="Add Check Box">\
<input type="button" onclick="AddStr()" value="Add String">\
<input type="button" onclick="AddRadio()" value="Add Radio">\
</form>'
var end = '\
<font size=24>The end</font>'
function rel(){
document.write(begin)
for (i=0;i<items.length;i++)
{
item=items[i]
document.write(item.getHTML())
}
document.write(end)
}
function AddRadio(){
items[items.length] = new Radio("Radio "+items.length, items.length)
}
function AddStr(){
items[items.length] = new str("String "+items.length, items.length)
}
function AddCheck(){
items[items.length] = new check("Checkbox "+items.length, items.length)
rel()
}
function AddScale(){
items[items.length] = new Scale("Scale "+items.length, items.length)
rel()
}
function str(label, varName) {
this.label = label
this.varName = varName
}
function choice(name) {
this.name = name
}
function addChoice(radio, name) {
radio.choices[radio.choices.length]=new choice(name)
}
function Radio(label, varName) {
this.label = label
this.varName = varName
this.choices = new Array()
}
function check(label, varName) {
this.label = label
this.varName = varName
function getHTML() {
return '<INPUT TYPE=CHECKBOX NAME="'+varName+'">'+label
}
}
function scale(label, varName) {
this.start=1
this.end=10
this.label = label
this.varName = varName
}
function AddScale()
{
var a = "h"
}
rel()
//document.write("<b>Hello</b>")
</script>
</body>
</html>