Trying to get a name in a function - Javascript
Posted: Mon Aug 23, 2004 11:56 am
Hello, I am trying to get the element image_url name to the new_text() function
I dont know how I would do this I am a beginner at javascript.
<script language="JavaScript">
function new_text(field_value){
document.form.+field_value+.value="New Text";
}
</script>
<input name="image_url5" type="text" onclick="new_text(this.value)">
The problem is that I have 30 textfields like this with all different names, so that is
why I am trying to use a function. Thanks
I dont know how I would do this I am a beginner at javascript.
<script language="JavaScript">
function new_text(field_value){
document.form.+field_value+.value="New Text";
}
</script>
<input name="image_url5" type="text" onclick="new_text(this.value)">
The problem is that I have 30 textfields like this with all different names, so that is
why I am trying to use a function. Thanks