0

I have an input button that calls a javascript function:

<input type="button" name="Add_OpStds_Step" id="Add_OpStds_Step" value="Add Step" onclick="Add_OpStds_Step();" />

The function that is called will add some labels, input boxes, and the things needed for a table. By itself it works just fine, as soon as I wrap it inside of a form tag, the button stops working. I'm using Firefox and Firebug 1.5.4 to assist in debugging and I can set break points in the javascript code. When there is no form tag the function is called, it hits the break point and I can step through the code, but when I add the form tags I get nothing. Farther down the page I have a submit button that works when I have the form tags.

<input name="submit" type="submit" value="Add" />

I have also tested this in IE8 and I get the same result.

The button is part of a page that get dynamically added inside a div with AJAX.

Any ideas as to why it's not working?

2
Contributors
2
Replies
4
Views
7 Years
Discussion Span
Last Post by dsumner25
0
<input type="button" name="Add_OpStds_Step" id="Add_OpStds_Step" value="Add Step" onclick="Add_OpStds_Step();" />

The problem is that the button name="Add_OpStds_Step" string is the same as the name of the onclick= function.
Remove it or change it to anything else.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.