Answer the question
In order to leave comments, you need to log in
Inline js doesn't see inputs in WP admin, what could be the problem?
Hello everyone!
I ran into a problem in working with the script, or rather with WP.
I made a script that creates an input on the admin page in order to enter a number into it, and he registered the yurl in other inputs according to the template
:
$('body').append('<input type="text" name="mod" id="mod" placeholder="URL" >')
$("#mod").css("position", "absolute").css("top", 643).css("left", 281);
$("#mod").on( "change",function () {
$('#widget-sow-button-c52-url').val($('[name="mod"]').val());
$('#widget-sow-button-c60-url').val($('[name="mod"]').val());
$('#widget-sow-button-c50-url').val($('[name="mod"]').val());
$('#widget-sow-button-c50-url').val("/wp-content/uploads/2018/02/Graphics_and_illustrations/Soc_media_WEB/gs" + $('[name="mod"]').val() + "_original.zip");
$('#widget-sow-button-c52-url').val("/wp-content/uploads/2018/02/Graphics_and_illustrations/Soc_media_WEB/gs" + $('[name="mod"]').val() + "_eng.jpg");
$('#widget-sow-button-c60-url').val("/wp-content/uploads/2018/02/Graphics_and_illustrations/Soc_media_WEB/gs" + $('[name="mod"]').val() + "_ua.jpg");
$('#dcmsefi_url').val("/wp-content/uploads/2018/02/Graphics_and_illustrations/Soc_media_WEB/gs" + $('[name="mod"]').val() + "_ua.jpg");
$('[name="post_title"]').val("gs" + $('[name="mod"]').val());
});
$('body').append('<input type="button" value="Н" id="btn6" accesskey="ф" style="border-width: 0px; background: url(images/opacity.png);">')
$("#btn6").css("position", "absolute").css("top", 300).css("left", 600).css({ color: "red" });
$('#btn6').click(function(){
$('#widget-sow-button-c52-url').val($('[name="mod"]').val());
$('#widget-sow-button-c60-url').val($('[name="mod"]').val());
$('#widget-sow-button-c50-url').val($('[name="mod"]').val());
$('#widget-sow-button-c50-url').val("/wp-content/uploads/2018/02/Graphics_and_illustrations/Soc_media_WEB/gs" + $('[name="mod"]').val() + "_original.zip");
$('#widget-sow-button-c52-url').val("/wp-content/uploads/2018/02/Graphics_and_illustrations/Soc_media_WEB/gs" + $('[name="mod"]').val() + "_eng.jpg");
$('#widget-sow-button-c60-url').val("/wp-content/uploads/2018/02/Graphics_and_illustrations/Soc_media_WEB/gs" + $('[name="mod"]').val() + "_ua.jpg");
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question