javascript - Tracking changes in web application -



javascript - Tracking changes in web application -

i have application in user needs see changes have been made during latest edit. changes mean, changes made in inputs textarea, dropdowns.

i trying implement showing background image on right top , when user clicks background image, popup shown shows difference. using prototype 1.7.0.

my first question be:- 1. best approach implement functionality? 2. can set onclick on background image?

there functions in jquery library believe helpful you. if using prototype, guess there similar functionality may utilize.

i suggest writing code this:

var $input = $('input').add('textarea').add('select'); $input.each(function() { var id = $(this).attr('id'); var value = $(this).val(); var hiddenid = 'hidden' + id; var newhiddeninput = $("<input type='hidden'").val(value).attr('id',hiddenid); $(this).after(newhiddeninput); });

the above code create new hidden input each input, textarea, , select on page. have same value input duplicates. have id equivalent prepending id word 'hidden'.

i don't know if can attach click handler background image. if inputs enclosed within <div>, may able result want attaching click handler div.

in case, should have old values can compare them user's input can prepare summary of difference.

javascript html prototypejs

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -