The function nuSetValue() sets the value of a nuBuilder object.
If nuDebugMode is set to true in nuconfig.php, a warning is output in the developer console if the object (HTML element) does not exist.
This way you can see which objects do not exist or have been renamed and therefore can no longer be found.
E.g. to get the value of an Input Text Object:
Code: Select all
nuGetValue('my_text_input');
Code: Select all
$('my_text_input').val();
- To get the selected text of a Select object, pass a second parameter "text" nuGetValue('my_text_input', 'text');
- For a checkbox, the return value is true or false
E.g. to tick a Checkbox:
Code: Select all
nuSetValue('my_checkbox', true);
Code: Select all
$("#my_checkbox").prop('checked',true).change();