{"id":4300,"date":"2012-02-18T11:13:56","date_gmt":"2012-02-18T11:13:56","guid":{"rendered":"https:\/\/es.wordpress.org\/support\/topic\/combobox-dinamico\/"},"modified":"2016-08-06T00:12:47","modified_gmt":"2016-08-06T00:12:47","slug":"combobox-dinamico","status":"closed","type":"topic","link":"https:\/\/es.wordpress.org\/support\/topic\/combobox-dinamico\/","title":{"rendered":"Combobox dinamico"},"content":{"rendered":"<p>Hola a todos.<\/p>\n<p>Tengo un formulario realizado para wordpress. En \u00e9l el select menu lo utilizo para mostras las provincias de mi pais. Me gustaria crear otro select menu, que contenga las ciudades de la provincia seleccionada.<\/p>\n<p>Os dejo el codigo. Espero que me puedan ayudar.<\/p>\n<pre><code>&lt;?php\n\/*\nTemplate Name: Create a Job\n*\/\n?&gt;\n&lt;?php\nsession_start();\nob_start();\nset_time_limit(0);\nif($_REQUEST[&#039;backedit&#039;]==&#039;&#039;)\n{\n\t$_SESSION[&#039;ads_information_session&#039;] = array();\n}\nif(!$current_user-&gt;data-&gt;ID)\n{\n\twp_redirect(get_settings(&#039;home&#039;).&#039;\/index.php?page=login&#039;);\n\texit;\n}\nglobal $wpdb,$General;\n$generalinfo = $General-&gt;get_general_settings();\n\n$pid = $_REQUEST[&#039;pid&#039;];\n$data = array();\nif($_SESSION[&#039;ads_information_session&#039;][&#039;post&#039;])\n{\n\t$post_info = $_SESSION[&#039;ads_information_session&#039;][&#039;post&#039;];\n\t$data[&#039;post_title&#039;] =  $post_info[&#039;post_title&#039;];\n\t$data[&#039;description&#039;] =  $post_info[&#039;description&#039;];\n\t$data[&#039;post_location&#039;] = $post_info[&#039;post_location&#039;];\n\t$data[&#039;geo_latitude&#039;] = $post_info[&#039;geo_latitude&#039;];\n\t$data[&#039;geo_longitude&#039;] = $post_info[&#039;geo_longitude&#039;];\n\n\t$data[&#039;post_url&#039;] = $post_info[&#039;post_url&#039;];\n\t$data[&#039;owner_name&#039;] = $post_info[&#039;owner_name&#039;];\n\t$data[&#039;owner_email&#039;] = $post_info[&#039;owner_email&#039;];\n\t$data[&#039;owner_phone&#039;] = $post_info[&#039;owner_phone&#039;];\n\t$data[&#039;termid&#039;] = $post_info[&#039;termid&#039;];\n\t$data[&#039;post_tags&#039;] = $post_info[&#039;post_tags&#039;];\n\t$data[&#039;coupon_code&#039;] = $post_info[&#039;coupon_code&#039;];\n\t$data[&#039;feature_prd&#039;] = $post_info[&#039;feature_prd&#039;];\n\tif($_SESSION[&#039;ads_information_session&#039;][&#039;images&#039;])\n\t{\n\t\t$post_images = implode(&#039;,&#039;,$_SESSION[&#039;ads_information_session&#039;][&#039;images&#039;]);\n\t}\n}\nelseif($pid)\n{\n\t$post_info = $General-&gt;get_post_info($pid);\n\t$data[&#039;post_title&#039;] =  $post_info[&#039;post_title&#039;];\n\t$data[&#039;description&#039;] =  $post_info[&#039;post_content&#039;];\n\t$catinfoarr = get_the_category($post_info[&#039;ID&#039;]);\n\t$isfeature = &#039;&#039;;\n\tfor($c=0;$c&lt;count($catinfoarr);$c++)\n\t{\n\t\tif($catinfoarr[$c]-&gt;term_id == $generalinfo[&#039;feature_catid&#039;])\n\t\t{\n\t\t\t$isfeature = &#039;checked=&quot;checked&quot;&#039;;\n\t\t}else\n\t\t{\n\t\t\t$data[&#039;termid&#039;] = $catinfoarr[$c]-&gt;term_id;\n\t\t}\n\t}\n\t$data[&#039;post_location&#039;] = get_post_meta($post_info[&#039;ID&#039;], &#039;post_location&#039;, $single = true);\n\t$data[&#039;geo_latitude&#039;] = get_post_meta($post_info[&#039;ID&#039;], &#039;geo_latitude&#039;, $single = true);\n\t$data[&#039;geo_longitude&#039;] = get_post_meta($post_info[&#039;ID&#039;], &#039;geo_longitude&#039;, $single = true);\n\t$data[&#039;post_url&#039;] = get_post_meta($post_info[&#039;ID&#039;], &#039;post_url&#039;, $single = true);\n\t$data[&#039;owner_name&#039;] = get_post_meta($post_info[&#039;ID&#039;], &#039;owner_name&#039;, $single = true);\n\t$data[&#039;owner_email&#039;] = get_post_meta($post_info[&#039;ID&#039;], &#039;owner_email&#039;, $single = true);\n\t$data[&#039;owner_phone&#039;] = get_post_meta($post_info[&#039;ID&#039;], &#039;owner_phone&#039;, $single = true);\n\t$post_images = get_post_meta($post_info[&#039;ID&#039;], &#039;post_images&#039;, $single = true);\n\t$tagsarr = get_the_tags($post_info[&#039;ID&#039;]);\n\tif($tagsarr)\n\t{\n\t\t$tags = array();\n\t\tforeach($tagsarr as $key=&gt;$val)\n\t\t{\n\t\t$tags[] = $val-&gt;name;\n\t\t}\n\t\t$post_tags = implode(&#039;,&#039;,$tags);\n\t\t$data[&#039;post_tags&#039;] = $post_tags;\n\t}\n}\n\/\/echo &quot;&lt;pre&gt;&quot;;\n\/\/print_r($_SESSION[&#039;ads_information_session&#039;]);\n?&gt;\n\n&lt;?php get_header(); ?&gt;\n\n&lt;div id=&quot;page&quot;&gt;\n&lt;div id=&quot;content-wrap&quot; class=&quot;clearfix&quot; &gt;\n\n&lt;div id=&quot;content&quot; class=&quot;content-in-detail_form&quot;&gt;\n&lt;h1&gt;&lt;?php _e(POST_CLASSIFIED_PAGE_TITLE);?&gt; &lt;\/h1&gt;\n\n&lt;div class=&quot;clearfix&quot; &gt;&lt;p class=&quot;alignright &quot;&gt;\n&lt;span class=&quot;indicates&quot;&gt;*&lt;\/span&gt;\nIndicates mandatory fields &lt;\/p&gt;\n&lt;\/div&gt;\n\n&lt;form name=&quot;createjob_frm&quot; id=&quot;createjob_frm&quot; action=&quot;&lt;?php echo get_option(&#039;siteurl&#039;);?&gt;\/?page=adsview&quot; method=&quot;post&quot; enctype=&quot;multipart\/form-data&quot;&gt;\n&lt;input type=&quot;hidden&quot; name=&quot;pid&quot; value=&quot;&lt;?php echo $pid;?&gt;&quot; \/&gt;\n\n     &lt;div class=&quot;create_post_row clearfix&quot;&gt; &lt;label&gt;&lt;?php _e(SELECT_CAT_TEXT);?&gt; : &lt;span class=&quot;indicates&quot;&gt;*&lt;\/span&gt; &lt;\/label&gt;\n\n     &lt;select name=&quot;termid&quot;  id=&quot;termid&quot; class=&quot;select&quot;&gt;\n     &lt;option value=&quot;&quot;&gt;&lt;?php _e(SELECT_CAT_DL_TEXT);?&gt;&lt;\/option&gt;\n     &lt;?php\n    \t$blogcatids = $General-&gt;get_blog_catid();\n\t\t$excludecat = &#039;1, 96, 98,&#039;.$General-&gt;get_feature_catid();\n\t\tif($blogcatids)\n\t\t{\n\t\t\t$excludecat .= &#039;,&#039;.$blogcatids;\n\t\t}\n\n\t\techo  $General-&gt;get_category_dropdown_options($data[&#039;termid&#039;],$excludecat);\n\t ?&gt;\n     &lt;\/select&gt;\n      &lt;span id=&quot;termidInfo&quot;&gt;&lt;\/span&gt;\n      &lt;\/div&gt;  \n\n     &lt;div class=&quot;create_post_row clearfix&quot;&gt; &lt;label&gt; &lt;?php _e(ADS_TITLE_TEXT);?&gt; : &lt;span class=&quot;indicates&quot;&gt;*&lt;\/span&gt; &lt;\/label&gt;\n    &lt;input name=&quot;post_title&quot; id=&quot;post_title&quot; value=&quot;&lt;?php echo $data[&#039;post_title&#039;];?&gt;&quot; type=&quot;text&quot; class=&quot;textfield required email&quot; \/&gt;\n    &lt;span id=&quot;post_titleInfo&quot;&gt;&lt;\/span&gt;\n     &lt;\/div&gt;\n\n    &lt;div class=&quot;create_post_row clearfix&quot;&gt; &lt;label&gt; &lt;?php _e(LOCATION_TEXT);?&gt; : &lt;span class=&quot;indicates&quot;&gt;*&lt;\/span&gt;  &lt;\/label&gt;\n    &lt;input name=&quot;post_location&quot; id=&quot;post_location&quot; value=&quot;&lt;?php echo $data[&#039;post_location&#039;];?&gt;&quot; type=&quot;text&quot; class=&quot;textfield&quot;  \/&gt;\n    &lt;span id=&quot;post_locationInfo&quot;&gt;&lt;\/span&gt;\n     &lt;\/div&gt;\n      &lt;div class=&quot;create_post_row clearfix&quot; style=&quot;display:none&quot;&gt;\n\t\t &lt;?php require_once (TEMPLATEPATH . &#039;\/library\/map\/location_add_map.php&#039;);?&gt;\n         &lt;\/div&gt;\n       &lt;div class=&quot;create_post_row clearfix&quot; style=&quot;display:none&quot;&gt;\n        &lt;label&gt;&lt;?php echo EVENT_ADDRESS_LAT;?&gt; &lt;\/label&gt;\n        &lt;input type=&quot;text&quot; name=&quot;geo_latitude&quot; id=&quot;geo_latitude&quot; class=&quot;textfield&quot; value=&quot;&lt;?php echo $data[&#039;geo_latitude&#039;];?&gt;&quot; size=&quot;25&quot;  \/&gt;\n        &lt;span class=&quot;note&quot;&gt;&lt;?php echo GET_LATITUDE_MSG;?&gt;&lt;\/span&gt;\n     &lt;\/div&gt;\n     &lt;div class=&quot;create_post_row clearfix&quot; style=&quot;display:none&quot;&gt;\n        &lt;label&gt;&lt;?php echo EVENT_ADDRESS_LNG;?&gt; &lt;\/label&gt;\n        &lt;input type=&quot;text&quot; name=&quot;geo_longitude&quot; id=&quot;geo_longitude&quot; class=&quot;textfield&quot; value=&quot;&lt;?php echo $data[&#039;geo_longitude&#039;];?&gt;&quot; size=&quot;25&quot;  \/&gt;\n       &lt;span class=&quot;note&quot;&gt;&lt;?php echo GET_LOGNGITUDE_MSG;?&gt;&lt;\/span&gt;\n     &lt;\/div&gt;\n\n    &lt;div class=&quot;create_post_row&quot;&gt; &lt;label&gt; &lt;?php _e(DESCRIPTION_TEXT);?&gt; : &lt;!--&lt;span class=&quot;indicates&quot;&gt;*&lt;\/span&gt;--&gt;  &lt;\/label&gt;\n     &lt;textarea cols=&quot;&quot; rows=&quot;4&quot; class=&quot;textarea&quot; name=&quot;description&quot; id=&quot;description&quot;  &gt;&lt;?php echo $data[&#039;description&#039;];?&gt;&lt;\/textarea&gt;\n     &lt;span id=&quot;descriptionInfo&quot;&gt;&lt;\/span&gt;\n     &lt;input type=&quot;hidden&quot; name=&quot;description_max_len&quot; id=&quot;description_max_len&quot; value=&quot;&lt;?php echo $generalinfo[&#039;max_ads_char&#039;];?&gt;&quot; \/&gt;\n    &lt;?php\n    if($generalinfo[&#039;max_ads_char&#039;])\n\t{\n\t?&gt;\n\n        &lt;span class=&quot;note&quot;&gt; &lt;?php _e(MAX_CHARS_MSG);?&gt; &lt;?php echo $generalinfo[&#039;max_ads_char&#039;];?&gt;  &lt;?php _e(&#039;chars&#039;);?&gt;.&lt;\/span&gt;\n     &lt;?php\n     }\n\t ?&gt;\n      &lt;\/div&gt;\n     &lt;?php\n     global $user_identity;\n\tget_currentuserinfo();\n\t ?&gt;\n    &lt;div class=&quot;create_post_row clearfix&quot; &gt;  &lt;label&gt; &lt;?php _e(OWNER_NAME_TEXT);?&gt; : &lt;span class=&quot;indicates&quot;&gt;*&lt;\/span&gt;&lt;\/label&gt;\n     &lt;?php\n     if($data[&#039;owner_name&#039;])\n\t {\n\t \t$owner_name = $data[&#039;owner_name&#039;];\n\t }else\n\t {\n\t \t$owner_name = $current_user-&gt;data-&gt;display_name ;\n\t }\n\t if($data[&#039;owner_email&#039;])\n\t {\n\t \t$owner_email = $data[&#039;owner_email&#039;];\n\t }else\n\t {\n\t \t$owner_email = $current_user-&gt;data-&gt;user_email ;\n\t }\n\t $userinfoarr = unserialize($current_user-&gt;data-&gt;user_address_info);\n\t if($data[&#039;owner_phone&#039;])\n\t {\n\t \t$owner_phone = $data[&#039;owner_phone&#039;];\n\t }else\n\t {\n\t \t$owner_phone = $userinfoarr[&#039;user_phone&#039;] ;\n\t }\n\t if($data[&#039;post_url&#039;])\n\t {\n\t \t$post_url = $data[&#039;post_url&#039;];\n\t }else\n\t {\n\t \t$post_url = $current_user-&gt;data-&gt;user_url ;\n\t }\n\n\t ?&gt;\n     &lt;input name=&quot;owner_name&quot; id=&quot;owner_name&quot; value=&quot;&lt;?php echo $owner_name;?&gt;&quot; type=&quot;text&quot; class=&quot;textfield&quot;  \/&gt;\n     &lt;span id=&quot;owner_nameInfo&quot;&gt;&lt;\/span&gt;\n      &lt;\/div&gt;\n\n    &lt;div class=&quot;create_post_row clearfix&quot;&gt;  &lt;label&gt;&lt;?php _e(INQUIRY_EMAIL_TEXT);?&gt; : &lt;span class=&quot;indicates&quot;&gt;*&lt;\/span&gt; &lt;\/label&gt;\n      &lt;input name=&quot;owner_email&quot; id=&quot;owner_email&quot; value=&quot;&lt;?php echo $owner_email;?&gt;&quot; type=&quot;text&quot; class=&quot;textfield&quot;  \/&gt; &lt;span class=&quot;note&quot;&gt;&lt;?php _e(INQUIRY_EMAIL_TEXT_NOTE);?&gt; &lt;\/span&gt;\n      &lt;span id=&quot;owner_emailInfo&quot;&gt;&lt;\/span&gt;\n       &lt;\/div&gt;\n\n    &lt;div class=&quot;create_post_row clearfix&quot; style=&quot;display:none&quot;&gt; &lt;label&gt;&lt;?php _e(PHONE_TEXT);?&gt; : &lt;\/label&gt;\n    &lt;input name=&quot;owner_phone&quot; id=&quot;owner_phone&quot; value=&quot;&lt;?php echo $owner_phone;?&gt;&quot; type=&quot;text&quot; class=&quot;textfield&quot; \/&gt; &lt;\/div&gt;\n\n     &lt;div class=&quot;create_post_row clearfix&quot; style=&quot;display:none&quot;&gt; &lt;label&gt; &lt;?php _e(TAGS_TEXT);?&gt; : &lt;\/label&gt;\n      &lt;input name=&quot;post_tags&quot; id=&quot;post_tags&quot; value=&quot;&lt;?php echo $data[&#039;post_tags&#039;];?&gt;&quot; type=&quot;text&quot; class=&quot;textfield&quot; \/&gt; &lt;\/div&gt;\n\n     &lt;div class=&quot;create_post_row clearfix&quot; style=&quot;display:none&quot;&gt; &lt;label&gt; &lt;?php _e(URL_TEXT);?&gt; :  &lt;\/label&gt;\n    &lt;input name=&quot;post_url&quot; value=&quot;&lt;?php echo $post_url;?&gt;&quot; type=&quot;text&quot; class=&quot;textfield&quot; \/&gt;\n    &lt;span class=&quot;note&quot;&gt; &lt;?php _e(URL_TEXT_NOTE);?&gt; &lt;\/span&gt;\n   &lt;\/div&gt; \n\n    &lt;div class=&quot;create_post_row clearfix&quot;&gt; &lt;label&gt; &lt;?php _e(UPLOAD_IMAGES_TEXT);?&gt; &lt;\/label&gt;\n\n     &lt;?php \/*?&gt;&lt;input name=&quot;images[]&quot; value=&quot;&quot; type=&quot;file&quot; class=&quot;jobtextfield&quot; \/&gt;&lt;?php *\/?&gt;\n\n    &lt;div class=&quot;upload&quot;&gt;\n    &lt;input name=&quot;fileId&quot; id=&quot;fileId&quot; value=&quot;&quot; type=&quot;hidden&quot;&gt;\n    &lt;input name=&quot;fileTitle&quot; id=&quot;fileTitle&quot; value=&quot;&quot; type=&quot;hidden&quot;&gt;\n    &lt;input value=&quot;1&quot; name=&quot;Count&quot; id=&quot;Count&quot; type=&quot;hidden&quot;&gt;\n    &lt;input name=&quot;images[]&quot; value=&quot;&quot; type=&quot;file&quot; class=&quot;textfield&quot; \/&gt;\n   \t &lt;div id=&quot;file_div&quot;&gt; &lt;\/div&gt;\n   &lt;input type=&quot;button&quot; name=&quot;AddNew&quot; value=&quot;Add New&quot; class=&quot; addnew&quot; onClick=&quot;customClick(&#039;file&#039;,&#039;&#039;,&#039;&#039;,&#039;&#039;);&quot; \/&gt;\n \t&lt;\/div&gt;\n\n   &lt;div style=&quot;clear:both;&quot;&gt;\n     &lt;?php\n     if($post_images!=&#039;&#039;)\n\t {\n\t \t$post_images_arr = explode(&#039;,&#039;,$post_images);\n\t\tfor($i=0;$i&lt;count($post_images_arr);$i++)\n\t\t{\n\t\t\t?&gt;\n\n           &lt;div style=&quot;width:50px;   float:left; margin:0 11px 11px 0; &quot; id=&quot;img_&lt;?php echo $i;?&gt;&quot; &gt;\n           &lt;img src=&quot;&lt;?php bloginfo(&#039;template_directory&#039;); ?&gt;\/thumb.php?src=&lt;?php echo $post_images_arr[$i]; ?&gt;&amp;w=50&amp;h=50&amp;zc=1&lt;?php echo $thumb_url;?&gt;&quot; alt=&quot;&lt;?php the_title(); ?&gt;&quot;   \/&gt;\n           &lt;input type=&quot;hidden&quot; name=&quot;hidden_image[]&quot; value=&quot;&lt;?php echo $post_images_arr[$i]; ?&gt;&quot; \/&gt;\n           &lt;a href=&quot;javascript:void(0);&quot; onClick=&quot;removeImage(&#039;&lt;?php echo $post_images_arr[$i]; ?&gt;&#039;,&#039;img_&lt;?php echo $i;?&gt;&#039;);&quot;&gt;&lt;?php _e(REMOVE_LINK_TEXT);?&gt;&lt;\/a&gt;\n           &lt;\/div&gt;\n\n            &lt;?php\n\t\t}\n\t }\n\t ?&gt;\n\t\t           &lt;\/div&gt;\n      &lt;\/div&gt;\n     &lt;input type=&quot;hidden&quot; name=&quot;type&quot; value=&quot;&lt;?php echo $_REQUEST[&#039;type&#039;];?&gt;&quot; \/&gt;\n     &lt;?php\n    if($_REQUEST[&#039;pid&#039;])\n\t{\n\t\tif($isfeature!=&#039;&#039;)\n\t\t{\n\t?&gt;\n    &lt;input type=&quot;hidden&quot; name=&quot;feature_prd&quot; value=&quot;1&quot; \/&gt;\n    &lt;strong&gt;&lt;?php _e(POST_ADS_FEATURE_MSG1);?&gt;&lt;\/strong&gt;\n    &lt;?php\n\t\t}\n\t}else\n\t{\n\t?&gt;\n    \t&lt;div class=&quot;create_post_row clearfix&quot; style=&quot;display:none&quot;&gt; &lt;label&gt; &lt;?php _e(COUPON_CODE_TEXT);?&gt; :  &lt;\/label&gt;\n        &lt;input name=&quot;coupon_code&quot; value=&quot;&lt;?php echo $data[&#039;coupon_code&#039;];?&gt;&quot; type=&quot;text&quot; class=&quot;textfield&quot; \/&gt;\n        &lt;span class=&quot;note&quot;&gt; &lt;?php _e(COUPON_CODE_TEXT_NOTE);?&gt; &lt;\/span&gt;\n       &lt;\/div&gt;\n    &lt;?php\n\t\t if($generalinfo[&#039;feature_catid&#039;])\n\t\t {\n\t\t?&gt;\n        &lt;div class=&quot;create_post_row clearfix&quot;&gt; &lt;span class=&quot;pay_basic&quot;&gt;&lt;?php _e(POST_ADS_FEATURE_MSG2);?&gt; &lt;strong&gt; &lt;?php echo $generalinfo[&#039;currencysym&#039;].$generalinfo[&#039;ads_price&#039;];?&gt;.&lt;\/strong&gt;&lt;\/span&gt;&lt;\/div&gt;\n\n\t\t&lt;div class=&quot;create_post_row clearfix row_spacer&quot;&gt;  &lt;span class=&quot;featured_ads_price&quot;&gt;  &lt;input type=&quot;checkbox&quot; &lt;?php echo $isfeature;?&gt; &lt;?php if($data[&#039;feature_prd&#039;]){ echo &#039;checked=&quot;checked&quot;&#039;;}?&gt;  name=&quot;feature_prd&quot; value=&quot;1&quot; \/&gt; &lt;?php _e(POST_ADS_FEATURE_MSG3);?&gt;\n\t\t&lt;?php if($isfeature ==&#039;&#039;){?&gt;\n\t\t&lt;?php _e(POST_ADS_FEATURE_MSG4);?&gt; &lt;strong class=&quot;extra_price&quot;&gt;  &lt;?php echo $generalinfo[&#039;currencysym&#039;].$generalinfo[&#039;feature_ads_price&#039;];?&gt; &lt;\/strong&gt; &lt;?php _e(POST_ADS_FEATURE_MSG5);?&gt;\n\t\t&lt;?php }?&gt;  &lt;\/span&gt;\n\t\t&lt;\/div&gt;\n\n\t\t&lt;?php\n\t\t }\n\t }\n\t ?&gt;\n     &lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;&lt;?php _e(PREVIEW_BUTTON);?&gt;&quot;  class=&quot;normal_button preview&quot; \/&gt;\n&lt;\/form&gt;\n&lt;script&gt;\nfunction removeImage(imagename,divid)\n{\n\tdocument.getElementById(divid).innerHTML=&#039;&#039;;\n}\n&lt;\/script&gt;\n&lt;script&gt;\nvar Row = 1;\nfunction customClick(customfield,nameval)\n{\n\tRow++;\n\n\tvar email_div = customfield+&#039;_div&#039;;\n\tvar emailDiv=document.getElementById(email_div);\n\tvar newDiv=document.createElement(&#039;div&#039;);\n\tnewDiv.setAttribute(&#039;id&#039;,email_div+Row);\n\tnewDiv.setAttribute(&#039;style&#039;,&#039;margin-top:5px&#039;);\n\tvar newTextBox=document.createElement(&#039;input&#039;);\n\n\tnewTextBox.type=&#039;file&#039;;\n\tnewTextBox.setAttribute(&#039;id&#039;,customfield+&#039;_name&#039;+Row);\n\tnewTextBox.setAttribute(&#039;name&#039;,&#039;images[]&#039;);\n\tnewTextBox.setAttribute(&#039;class&#039;,&#039;textbox&#039;);\n\tnewTextBox.setAttribute(&#039;size&#039;,&#039;15&#039;);\n\tnewTextBox.setAttribute(&#039;maxlength&#039;,&#039;50&#039;);\n\tnewTextBox.setAttribute(&#039;style&#039;,&#039;width:auto&#039;);\n\tif(nameval){newTextBox.setAttribute(&#039;value&#039;,nameval);}else{newTextBox.setAttribute(&#039;value&#039;,customfield);}\n\tnewTextBox.setAttribute(&quot;onblur&quot;,&quot;if(this.value==&#039;&#039;) this.value = &#039;&quot;+customfield+&quot;&#039;;&quot;);\n\tnewTextBox.setAttribute(&quot;onfocus&quot;,&quot;if(this.value==&#039;&quot;+customfield+&quot;&#039;) this.value= &#039;&#039;;&quot;);\n\n\tnameStr = document.getElementById(customfield+&#039;Title&#039;).value;\n\tvalueStr = document.getElementById(customfield+&#039;Id&#039;).value;\n\n\tvar newLink = document.createElement(&#039;a&#039;);\n\tnewLink.setAttribute(&#039;class&#039;,&#039;smallLink&#039;);\n\tnewLink.setAttribute(&#039;href&#039;,&#039;javascript:void(0)&#039;);\n\tnewLink.setAttribute(&#039;tabindex&#039;,&#039;2&#039;);\n\n\tdocument.getElementById(&#039;Count&#039;).value = Row;\n\n\tvar linkText=document.createTextNode(&#039;Remove&#039;);\n\tnewLink.appendChild(linkText);\n\tnewLink.onclick=function RemoveEntry() { var imDiv=document.getElementById(email_div);\n\n\temailDiv.removeChild(this.parentNode);\n\t}\n\n\tnewDiv.appendChild(newTextBox);\n\tnewDiv.appendChild(document.createTextNode(&#039;\\u00A0\\u00A0\\u00A0\\u00A0&#039;));\n\tnewDiv.appendChild(newLink);\n\temailDiv.appendChild(newDiv);\n}\n&lt;\/script&gt;\n&lt;script type=&quot;text\/javascript&quot; src=&quot;&lt;?php bloginfo(&#039;template_directory&#039;); ?&gt;\/library\/js\/jquery.js&quot;&gt;&lt;\/script&gt;\n&lt;script type=&quot;text\/javascript&quot; src=&quot;&lt;?php bloginfo(&#039;template_directory&#039;); ?&gt;\/library\/js\/adv_validation.js&quot;&gt;&lt;\/script&gt;\n&lt;\/div&gt;&lt;!--content end --&gt;\n&lt;!-- TinyMCE --&gt;\n&lt;script type=&quot;text\/javascript&quot; src=&quot;&lt;?php bloginfo(&#039;template_directory&#039;); ?&gt;\/library\/js\/tiny_mce\/tiny_mce.js&quot;&gt;&lt;\/script&gt;\n&lt;script type=&quot;text\/javascript&quot;&gt;\n\ttinyMCE.init({\n\t\t\/\/ General options\n\t\tmode : &quot;textareas&quot;,\n\t\ttheme : &quot;advanced&quot;,\n\t\tplugins :&quot;advimage,advlink,iespell,&quot;,\n\n\t\t\/\/ Theme options\n\t\ttheme_advanced_buttons1 : &quot;bold,italic,underline,strikethrough,|,bullist,numlist,blockquote,|,link,unlink,anchor,image,code&quot;,\n\t\ttheme_advanced_buttons2 : &quot;&quot;,\n\t\ttheme_advanced_buttons3 : &quot;&quot;,\n\t\ttheme_advanced_buttons4 : &quot;&quot;,\n\t\ttheme_advanced_toolbar_location : &quot;top&quot;,\n\t\ttheme_advanced_toolbar_align : &quot;left&quot;,\n\t\ttheme_advanced_statusbar_location : &quot;bottom&quot;,\n\t\ttheme_advanced_resizing : true,\n\n\t\t\/\/ Example word content CSS (should be your site CSS) this one removes paragraph margins\n\t\tcontent_css : &quot;css\/word.css&quot;,\n\n\t\t\/\/ Drop lists for link\/image\/media\/template dialogs\n\t\ttemplate_external_list_url : &quot;lists\/template_list.js&quot;,\n\t\texternal_link_list_url : &quot;lists\/link_list.js&quot;,\n\t\texternal_image_list_url : &quot;lists\/image_list.js&quot;,\n\t\tmedia_external_list_url : &quot;lists\/media_list.js&quot;,\n\n\t\t\/\/ Replace values for the template plugin\n\t\ttemplate_replace_values : {\n\t\t\tusername : &quot;Some User&quot;,\n\t\t\tstaffid : &quot;991234&quot;\n\t\t}\n\t});\n&lt;\/script&gt;\n&lt;!-- \/TinyMCE --&gt;\n&lt;?php include (TEMPLATEPATH . &quot;\/footer_index.php&quot;); ?&gt;<\/code><\/pre>\n","protected":false},"template":"","class_list":["post-4300","topic","type-topic","status-closed","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/es.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/4300","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/es.wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/es.wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/es.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/4300\/revisions"}],"wp:attachment":[{"href":"https:\/\/es.wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=4300"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}