Jump to content

document.form. <textbox name> .value=""... returns an error.


JP128

Recommended Posts

<script language="javascript">

function clearData(fieldName){

document.form1.fieldName.value="";

}

</script>

 

 

How would I go about this? I want to be able to create an input field, with onClick="clearData('username');"...

 

I have tried:

document.form1.fieldName.value="";

document.form1.'fieldName'.value="";

document.form1.+fieldName+.value="";

document.form1.+ "fieldName" +.value="";

Link to comment
https://forums.phpfreaks.com/topic/37989-documentform-value-returns-an-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.