I don't see anywhere in your code where you'd display that name.
Notes:
1) function1() just returns the name entered in the checkbox.
2) function1() is ONLY called by your radio buttons onClick event, and nothing is done with the return value.
That means you're just throwing the value away -- you're not DOING anything with it.
Your hidden input field has a value of "name". That's just a string, "name". It's in no way related to the local variable you define within the scope of function1().
Perhaps you meant to do this:
function function1()
{
var name = prompt("Please enter your name", "");
if ((name != null) && (name != ""))
{
document.form1.hidden1.value = name;
}
}
See the difference? You're actually DOING something with the value returned from the prompt box -- you're assigning the value property of the hidden1 object (which translates into the value attribute of the hidden1 element in HTML).
You need to wrap your form input elements in a <form name="form1"> tag for this to work.
You've been asking a lot of JavaScript questions lately -- remember that this is a PHP forum, so in the future you should direct your JavaScript questions to the appropriate forum -- there's several to choose from.
Take care,
Nik
http://www.bigaction.org/