dynamically load dns-record help-text for selected dns-type; fixes #719

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2022-05-15 11:45:50 +02:00
parent ed7faae947
commit dd896659ae
6 changed files with 55 additions and 4 deletions

View File

@@ -137,9 +137,6 @@
{% if field.type == 'hidden' and field.display is defined %}
<input type="text" readonly class="form-control-plaintext" value="{{ field.display }}">
{% endif %}
{% if field.note is defined and field.note is not empty %}
<div class="invalid-feedback">{{ field.note|raw }}</div>
{% endif %}
{% if field.next_to is defined %}
{% for nid, nfield in field.next_to %}
{% if nfield.next_to_prefix is defined %}

View File

@@ -0,0 +1,19 @@
$(function () {
// Display helptext to content box according to dns-record type selected
$("select[name='dns_type']").on('change', function () {
var selVal = $(this).val();
$.ajax({
url: "lib/ajax.php?action=loadLanguageString",
type: "POST",
dataType: "json",
data: { langid: 'dnseditor.notes.' + selVal },
success: function (data) {
$("#dns_content").next().html(data);
},
error: function (request, status, error) {
console.log(request, status, error)
}
});
});
});

View File

@@ -22,3 +22,4 @@ require('./components/domains')
require('./components/configfiles')
require('./components/apikeys')
require('./components/install')
require('./components/dnseditor')