Instead of calling the confiirm from onclick you can call another javascript function which checks to see if the text has changed. Maybe you can add a onchange to that textbox that sets a dirty bit when its changed and the new method checks that dirty bit.