{"id":2192,"date":"2012-06-12T08:58:09","date_gmt":"2012-06-12T06:58:09","guid":{"rendered":"http:\/\/blog.unelink.es\/?p=2192"},"modified":"2012-06-11T16:59:17","modified_gmt":"2012-06-11T14:59:17","slug":"cambiar-el-valor-de-un-input-desde-una-ventana-modal","status":"publish","type":"post","link":"https:\/\/hosting.airetech.es\/blog\/wiki\/cambiar-el-valor-de-un-input-desde-una-ventana-modal\/","title":{"rendered":"Cambiar el valor de un INPUT desde una ventana modal"},"content":{"rendered":"<p>Para cambiar el valor del atributo value de un HTML INPUT desde una ventana modal, podemos hacerlo de 2 maneras: bien con JQuery o desde los propios mecanismos que Javascript nos ofrece.<\/p>\n<p>Con JQuery<\/p>\n<pre>\r\n$('.SELECTOR.', window.parent.document).val('valor_input');\r\n<\/pre>\n<p>Sin JQuery<\/p>\n<pre>\r\nwindow.parent.document.getElementById('id_del_input').value='valor';  \r\n<\/pre>\n<p>Como se puede observar, sin JQuery debemos conocer el id del nodo input mientras que con JQuery podemos hacer la b\u00fasqueda mediante un selector.<\/p>\n","protected":false},"excerpt":{"rendered":"Para cambiar el valor del atributo value de un HTML INPUT desde una ventana modal, podemos hacerlo de 2 maneras: bien con JQuery o desde los propios mecanismos que Javascript nos ofrece. Con JQuery $('.SELECTOR.', window.parent.document).val('valor_input'); Sin JQuery window.parent.document.getElementById('id_del_input').value='valor'; Como se puede observar, sin JQuery debemos conocer el id del nodo input mientras que con JQuery podemos hacer la b\u00fasqueda&nbsp;<a href=\"https:\/\/hosting.airetech.es\/blog\/wiki\/cambiar-el-valor-de-un-input-desde-una-ventana-modal\/\" class=\"read-more\">Seguir leyendo<\/a>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[132,6],"tags":[136,133,134,135],"class_list":["post-2192","post","type-post","status-publish","format-standard","hentry","category-javascript","category-wiki","tag-input","tag-javascript-2","tag-jquery","tag-modal","cat-132-id","cat-6-id"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/posts\/2192","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/comments?post=2192"}],"version-history":[{"count":3,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/posts\/2192\/revisions"}],"predecessor-version":[{"id":2286,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/posts\/2192\/revisions\/2286"}],"wp:attachment":[{"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/media?parent=2192"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/categories?post=2192"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/tags?post=2192"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}