Note that there are some explanatory texts on larger screens.

plurals
  1. POForm request is not working in FF (Firefox) but working in Chrome
    text
    copied!<p>i am using jquery to get rails Html code in my page..so i am using this code:-</p> <pre><code>$("#but").html( ''+ '&lt;div class = "newb"&gt;'+ '&lt;table&gt;'+ '&lt;tr&gt;'+ '&lt;%= link_to "Add a Patient", "/outpatient_detail",:class=&gt;"btn btn-primary",:style=&gt;"color:white" %&gt;'+ '&lt;%= form_tag("/PatientManagement/delete", method: "post",:id=&gt;"testform") do %&gt;'+ '&lt;%= text_field_tag "patientIdsDel",nil,:type=&gt;"hidden" %&gt;'+ '&lt;%= text_field_tag "hospitalId",current_user.hospital.id,:type=&gt;"hidden"%&gt;'+ '&lt;%= text_field_tag "processType","outpatient",:type=&gt;"hidden"%&gt;'+ '&lt;%= text_field_tag "finalJson","",:type=&gt;"hidden"%&gt;'+ '&lt;%= text_field_tag "imppath",@pathimp[0],:type=&gt;"hidden"%&gt;'+ '&lt;%= text_field_tag "exportP",@pathimp[7],:type=&gt;"hidden"%&gt;'+ '&lt;%= submit_tag "Delete Selected",:id=&gt;"2",:onclick =&gt; "return del()",:class=&gt;"btn btn-primary"%&gt;'+ '&lt;%end%&gt;'+ '&lt;/tr&gt;'+ '&lt;/table&gt;'+ '&lt;/div&gt;' ); </code></pre> <p>this code is working perfectly in google chrome ,safari but not working in FF, IE , Opera. so how can i resolve it? its generated html is:- <img src="https://i.stack.imgur.com/fQkmD.png" alt="enter image description here"></p> <p>my del() is</p> <pre><code>function del(){ //alert("in del") var arl=document.getElementById("patientIdsDel").value=keys(arr); //alert(arl) var tempA = keys(arr) for(var i=0;i&lt;tempA.length;i++){ tempA[i]+'"'+":"+arr[tempA[i]] } var hid=document.getElementById("hospitalId").value; var ptype=document.getElementById("processType").value; //alert(ptype+hid) var jsonObj = { "hospitalId": hid, "processType":ptype }; var patientIDs = {}; for(var i=0;i&lt;tempA.length;i++){ patientIDs[tempA[i]] = arr[tempA[i]]; } jsonObj["patientIDs"]=patientIDs; var jsonString = JSON.stringify(jsonObj); // alert(jsonString) var ee= document.getElementById("patientIdsDel").value=jsonString; if(arl==0) { alert("No Records Selected") return false }else { return true } } </code></pre> <p>here is my arr description how i am updating it</p> <pre><code>if(selected==true){ if(arr[model.attributes.PatientId]==undefined) { arr[model.attributes.PatientId] = "'"+model.attributes.MeasureCategory+"'"; } else { arr[model.attributes.PatientId]=arr[model.attributes.PatientId]+",'"+model.attributes.MeasureCategory+"'"; } // arr[model.attributes.PatientId] = "'"+model.attributes.MeasureCategory+"'"; } else if(selected==false){ var str=arr[model.attributes.PatientId]; var n =arr[model.attributes.PatientId].split(","); var len=n.length; if(len==1) { delete arr[model.attributes.PatientId]; //alert(arr[model.attributes.PatientId]) } else{ for(i=0;i&lt;=len;i++) { if(n[i]=="'"+model.attributes.MeasureCategory+"'") { if(i==len-1) str=str.replace(",'"+model.attributes.MeasureCategory+"'",""); else str=str.replace("'"+model.attributes.MeasureCategory+"',",""); arr[model.attributes.PatientId]=str; //alert(arr[model.attributes.PatientId]) } } // alert(n[0]+","+n[1]) // alert(model.attributes.MeasureCategory) } </code></pre>
 

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