<form name="myForm">
<input type="text" name="f['cart']]['product_name']"/>
</form>
How can I access textfield's value using javascript?
Get the form from the forms collection, then the input from said form's elements collection.
document.forms['myForm'].elements["f['cart']]['product_name']"]
nameon<form>is a legacy attribute that only exists for backwards compatibility with truly ancient browsers. Useidinstead.