Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
protogrid:script_library [2020-04-18 14:05] – [Execute JS on card load] dru | protogrid:script_library [2021-01-22 14:50] – [Execute JS on field change] dru | ||
---|---|---|---|
Line 79: | Line 79: | ||
The function document_ready_trigger tells your card that you want something to happen when a value changes. The call " | The function document_ready_trigger tells your card that you want something to happen when a value changes. The call " | ||
+ | |||
+ | ==== Manipulate Contet of Rich Text Field ==== | ||
+ | |||
+ | <code javascript> | ||
+ | var rich_text_editor = $("#" | ||
+ | |||
+ | var content = rich_text_editor.getDocument().toString(); | ||
+ | rich_text_editor.setSelectedRange([0, | ||
+ | rich_text_editor.setSelectedRange([0, | ||
+ | var current_range = rich_text_editor.getSelectedRange(); | ||
+ | rich_text_editor.insertString(" | ||
+ | rich_text_editor.insertHTML("< | ||
+ | rich_text_editor.insertLineBreak(); | ||
+ | rich_text_editor.deleteInDirection(" | ||
+ | rich_text_editor.activateAttribute(" | ||
+ | rich_text_editor.deactivateAttribute(" | ||
+ | </ | ||
+ | |||
+ | Please see https:// |