said_fox
07-01-2003, 06:11 PM
Hi,
I want to change the form element name. I do this for the form element value
so easy, but I can not do it for the name.
Suppose the following code:
<form name="forma">
<input type="text" name="mytxt">
<input type="button" onMouseDown="process()">
</form>
Now what can I do to change the document.forma.mytxt Name to any thing
else? using the process() as follow:
<script>
function process(){
document.forma.mytxt.value="Hello";//this is works so nice
document.forma.mytxt.name="yourtxt";// As I do Nothing
alert(document.forma.yourtxt.value);//An Error message
}
</script>
:confused: :confused:
I want to change the form element name. I do this for the form element value
so easy, but I can not do it for the name.
Suppose the following code:
<form name="forma">
<input type="text" name="mytxt">
<input type="button" onMouseDown="process()">
</form>
Now what can I do to change the document.forma.mytxt Name to any thing
else? using the process() as follow:
<script>
function process(){
document.forma.mytxt.value="Hello";//this is works so nice
document.forma.mytxt.name="yourtxt";// As I do Nothing
alert(document.forma.yourtxt.value);//An Error message
}
</script>
:confused: :confused: