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?

Recommended Answers

All 2 Replies

<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.

Thank you! Worked perfectly.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.