Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <ul> <li>Read the ids+values of all your fields when the page first loads (using something like jquery to get all "textarea", "input" and "select" tags for example)</li> <li>On submit, compare the now contained values to what you stored on loading the page</li> <li>Replace the ones that have not changed with empty values</li> </ul> <p>If it's still unclear, describe where you're getting stuck and I'll describe more in depth.</p> <p><strong>Edit:</strong> Adding some code, using jQuery. It's only for the textarea-tag and it doesn't respond to the actual events, but hopefully it explains the idea further:</p> <pre><code>// Keep default values here var defaults = {}; // Run something like this on load $('textarea').each(function(i, e) { defaults[$(e).attr('id')] = $(e).text(); }); // Run something like this before submit $('textarea').each(function(i, e){ if (defaults[$(e).attr('id')] === $(e).text()) $(e).text(''); }) </code></pre> <p><strong>Edit:</strong> Adding some more code for more detailed help. This should be somewhat complete code (with a quality disclaimer since I'm by no means a jQuery expert) and just requires to be included on your page. Nothing else has to be done, except giving all your input tags unique ids and type="text" (but they should have that anyway):</p> <pre><code>$(document).ready(function(){ // Default values will live here var defaults = {}; // This reads and stores all text input defaults for later use $('input[type=text]').each(function(){ defaults[$(this).attr('id')] = $(this).text(); }); // For each of your submit buttons, // add an event handler for the submit event // that finds all text inputs and clears the ones not changed $('input[type=submit]').each(function(){ $(this).submit(function(){ $('input[type=text]').each(function(){ if (defaults[$(this).attr('id')] === $(this).text()) $(this).text(''); }); }); }); }); </code></pre> <p>If this still doesn't make any sense, you should read some tutorials about jQuery and/or javascript.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload