Note that there are some explanatory texts on larger screens.

plurals
  1. POForms elements don't insert with the correct jquery mobile design
    primarykey
    data
    text
    <p>I built a form using jquery. As soon as I use $('#Form').append(''); the newly added elements aren't themed / don't look the same way as I they would, when I insert them using PHP.</p> <p>To make it clear:</p> <p>php added: Jquery Mobile Style</p> <p>Jquery dynamicly added: Regular Form style.</p> <p>How can I buy pass this?</p> <p>======ADDON====== Ok, here's the code</p> <p>this functions adds the block:</p> <pre><code>function addItem(section){ if(itemcounter[section]&gt;1){ $('table#deductionItemContent'+section+' tr:last').after('&lt;tr id="deductionItemContentRow'+section+'_'+itemcounter[section]+'1"&gt;&lt;/tr&gt;'); $('table#deductionItemContent'+section+' tr:last').after('&lt;tr id="deductionItemContentRow'+section+'_'+itemcounter[section]+'2"&gt;&lt;/tr&gt;'); $('table#deductionItemContent'+section+' tr:last').after('&lt;tr id="deductionItemContentRow'+section+'_'+itemcounter[section]+'3"&gt;&lt;/tr&gt;'); }else{ $('#deductionItemContent'+section).append('&lt;tr id="deductionItemContentRow'+section+'_'+itemcounter[section]+'1"&gt;&lt;/tr&gt;'); $('#deductionItemContent'+section).append('&lt;tr id="deductionItemContentRow'+section+'_'+itemcounter[section]+'2"&gt;&lt;/tr&gt;'); $('#deductionItemContent'+section).append('&lt;tr id="deductionItemContentRow'+section+'_'+itemcounter[section]+'3"&gt;&lt;/tr&gt;'); } $('#deductionItemContent'+section).append('&lt;tr id="deductionItemContentRow'+section+'_'+itemcounter[section]+'1"&gt;&lt;/tr&gt;'); $('#deductionItemContent'+section).append('&lt;tr id="deductionItemContentRow'+section+'_'+itemcounter[section]+'2"&gt;&lt;/tr&gt;'); $('#deductionItemContent'+section).append('&lt;tr id="deductionItemContentRow'+section+'_'+itemcounter[section]+'3"&gt;&lt;/tr&gt;'); $('#deductionItemContentRow'+section+'_'+itemcounter[section]+'1').append('&lt;td id="deductionItemContent'+section+'El'+itemcounter[section]+'"&gt;&lt;/td&gt;'); $('#deductionItemContent'+section+'El'+itemcounter[section]).append('&lt;div class="type-select"&gt;&lt;label for="nu_item_'+section+'_'+itemcounter[section]+'"&gt;{/literal}{translate text="application_reports_plate5_item"}{literal}'+itemcounter[section]+'&lt;/label&gt;&lt;select onchange="updateForm('+section+');" id="nu_item_'+section+'_'+itemcounter[section]+'" name="nu_item_'+section+'_'+itemcounter[section]+'"&gt;&lt;/select&gt;&lt;/div&gt;') $('#nu_item_'+section+'_'+itemcounter[section]).append('&lt;option value="main"&gt;{/literal}{translate text="application_reports_plate5_item_main"}{literal}&lt;/option&gt;'); $('#nu_item_'+section+'_'+itemcounter[section]).append('&lt;option value="aux"&gt;{/literal}{translate text="application_reports_plate5_item_aux"}{literal}&lt;/option&gt;'); $('#nu_item_'+section+'_'+itemcounter[section]).append('&lt;option value="jib"&gt;{/literal}{translate text="application_reports_plate5_jib"}{literal}&lt;/option&gt;'); $('#nu_item_'+section+'_'+itemcounter[section]).append('&lt;option value="rope"&gt;{/literal}{translate text="application_reports_plate5_rope"}{literal}&lt;/option&gt;'); $('#nu_item_'+section+'_'+itemcounter[section]).append('&lt;option value="underhookdevice"&gt;{/literal}{translate text="application_reports_plate5_underhookdevice"}{literal}&lt;/option&gt;'); $('#nu_item_'+section+'_'+itemcounter[section]).append('&lt;option value="rigging"&gt;{/literal}{translate text="application_reports_plate5_rigging"}{literal}&lt;/option&gt;'); $('#nu_item_'+section+'_'+itemcounter[section]).append('&lt;option value="none"&gt;{/literal}{translate text="application_reports_plate5_none"}{literal}&lt;/option&gt;'); $('#deductionItemContentRow'+section+'_'+itemcounter[section]+'2').append('&lt;td id="deductionItemContent'+section+'E2'+itemcounter[section]+'"&gt;&lt;/td&gt;'); $('#deductionItemContent'+section+'E2'+itemcounter[section]).append('&lt;div class="type-select"&gt;&lt;label for="nu_status_'+section+'_'+itemcounter[section]+'"&gt;{/literal}{translate text="application_reports_plate5_itemstatus"}{literal} '+'&lt;/label&gt;&lt;select onchange="updateForm('+section+');" id="nu_status_'+section+'_'+itemcounter[section]+'" name="nu_status_'+section+'_'+itemcounter[section]+'"&gt;&lt;/select&gt;&lt;/div&gt;') $('#nu_status_'+section+'_'+itemcounter[section]).append('&lt;option value="stowed"&gt;{/literal}{translate text="application_reports_plate5_item_stowed"}{literal}&lt;/option&gt;'); $('#nu_status_'+section+'_'+itemcounter[section]).append('&lt;option value="erected"&gt;{/literal}{translate text="application_reports_plate5_item_erected"}{literal}&lt;/option&gt;'); $('#nu_status_'+section+'_'+itemcounter[section]).append('&lt;option value="inservice"&gt;{/literal}{translate text="application_reports_plate5_item_inservice"}{literal}&lt;/option&gt;'); $('#nu_status_'+section+'_'+itemcounter[section]).append('&lt;option value="none"&gt;{/literal}{translate text="application_reports_plate5_none"}{literal}&lt;/option&gt;'); $('#deductionItemContentRow'+section+'_'+itemcounter[section]+'3').append('&lt;td id="deductionItemContent'+section+'E3'+itemcounter[section]+'"&gt;&lt;/td&gt;'); $('#deductionItemContent'+section+'E3'+itemcounter[section]).append('&lt;div class="type-text"&gt;&lt;label for="nu_deduction_'+section+'_'+itemcounter[section]+'"&gt;{/literal}{translate text="application_reports_plate5_deduction"}{literal}&lt;/label&gt;&lt;input onkeyup="updateForm('+section+');" type="text" length="6" maxlength="6" id="nu_deduction_'+section+'_'+itemcounter[section]+'" name="nu_deduction_'+section+'_'+itemcounter[section]+'" /&gt;&lt;/div&gt;'); /** * Add Data to page 3 */ $('#weightMasterDataTable'+section).append('&lt;tr id="weightMasterDataTableRow'+section+itemcounter[section]+'"&gt;&lt;/tr&gt;'); $('#weightMasterDataTableRow'+section+itemcounter[section]).append('&lt;td id="weightMasterDataTableContent'+section+itemcounter[section]+'1"&gt;&lt;/td&gt;'); $('#weightMasterDataTableRow'+section+itemcounter[section]).append('&lt;td id="weightMasterDataTableContent'+section+itemcounter[section]+'2"&gt;&lt;/td&gt;'); $('#weightMasterDataTableRow'+section+itemcounter[section]).append('&lt;td id="weightMasterDataTableContent'+section+itemcounter[section]+'3"&gt;0&lt;/td&gt;'); $('#weightMasterDataTableRow'+section+itemcounter[section]).append('&lt;td id="weightMasterDataTableContent'+section+itemcounter[section]+'4"&gt;0&lt;/td&gt;'); $('#weightMasterDataTableRow'+section+itemcounter[section]).append('&lt;td id="weightMasterDataTableContent'+section+itemcounter[section]+'5"&gt;0&lt;/td&gt;'); /** * Add Radio Buttons */ $('#weightMasterDataButtons'+section).append('&lt;input type="radio" name="nu_masterbutton_'+section+'" id="nu_masterbutton_'+section+'_'+itemcounter[section]+'" value="'+itemcounter[section]+'" /&gt;&lt;label for="nu_masterbutton_'+section+'_'+itemcounter[section]+'" &gt;&amp;nbsp;&amp;nbsp;{/literal}{translate text="application_reports_plate5_item"}{literal} '+itemcounter[section]+'&lt;/label&gt;'); $('#weightMasterDataButtons'+section).append('&lt;br /&gt;'); /** * in the end update counter */ itemcounter[section]++; } </code></pre> <p>the HTML code that belongs to this looks like this:</p> <pre><code>&lt;tr&gt; &lt;td&gt; &lt;div id="tabs-2"&gt; &lt;h4&gt;deductions for loadtest 1&lt;/h4&gt; &lt;div id="deductions1"&gt; &lt;a onclick="addItem(1);"&gt;+ Add item to deduction&lt;/a&gt; &lt;table id="deductionMaster1" class="tablecloth" width="100%" cellspacing="0" cellpadding="0" border="0"&gt; &lt;tbody&gt; &lt;tr id="deductionMasterRow11"&gt; &lt;td&gt; &lt;table id="deductionItemContent1" class="tablecloth" width="100%" cellspacing="0" cellpadding="0" border="0"&gt;&lt;/table&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr id="deductionMasterRow12"&gt; &lt;td id="deductionMasterElement12"&gt; total: &lt;b id="deductionValue1"&gt;0&lt;/b&gt; lbs &lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/div&gt; &lt;/div&gt; &lt;/td&gt; &lt;/tr&gt; </code></pre> <p>This is only a small part of the form, because everything reacts the same way. I guess I need to tell the browser somewho that the inserted form elements are to be themed the jquery style. But I don't know how to.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload