I have a java script code which will set some values in a form
function editCategory(categoryId) {
$.ajax({
type: "POST",
url: "/product/fetchEditCategory",
data: "categoryId=" + categoryId,
success: function(response){
var productManagerForm = document.getElementById('productManager');
productManagerForm.ceName.value = response.catName;........
My JSP is –
<form id="productManager" name="productManager" action="/product/" method="post">
<div id="editCategory">
<tr>
<td style="font-weight:bold;">Category Name</td>
<td><input type="text" id="ceName" /></td>
</tr>
</div>
<td><a href="#editCategory" id="cat" onclick="editCategory('p1')">edit</a></td>
I am getting following error on running this code –
Message: 'ceName' is null or not an object
Can someone please tell me what is the issue here?
ceName cannot be accessed as a property of productManagerForm.
Try this: