Jump to content
  • 0

Loading... Issue In Cascading Text Area


ababcock
 Share

Question

I have text areas in a submission form that load based on the selection a user makes. I am running into a problem where this is sometimes taking way too long, and while it works on it, the fields fill in with "Loading..." If a user submits the form before the fields load, the field remains filled in with "Loading..." rather than the data that should be there. Is there any way to speed that up? Is it just because the table is getting full of data, so the lookup is taking too long? Has anyone run into a similar issue?

 

Thanks for you help!

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

It currently includes 150 records with 175 fields (1.05 MB). Since I need to pull up text with more than 255 characters, I had to use javascript to create a cascading text area. Here is the javascript (the lower part refers to calculating the total hours based on a start time and end time entered):

 

<script>
function changeVal() {
setTimeout(function(){
if (document.getElementsByName('cbParamVirtual1')[0].textContent != "First make your selection above")
{
document.getElementById('InsertRecordClient_Goals').value = document.getElementsByName('cbParamVirtual1')[0].textContent;}
else
{
document.getElementById('InsertRecordClient_Goals').value ="";}
 
if (document.getElementsByName('cbParamVirtual5')[0].textContent != "First make your selection above")
{
document.getElementById('InsertRecordOngoing_Supports').value = document.getElementsByName('cbParamVirtual5')[0].textContent;}
else
{
document.getElementById('InsertRecordOngoing_Supports').value ="";}
 
}, 1000);
}
 
document.getElementsByName('InsertRecordClient_Name')[0].onchange= changeVal;
 
document.getElementById('Submit').onmouseover = function(){
 
var date = document.getElementById('InsertRecordDate_of_Service').value;
if(date == "")
date = "1/1/2011";
var hour = document.getElementById('cbParamVirtual2').value;
if(hour =="")
hour="00";
var minute = document.getElementById('cbParamVirtual3').value;
if(minute == "")
minute = "00";
var ampm = document.getElementById('cbParamVirtual4').value;
 
document.getElementById('InsertRecordStart_Time').value = date + " " + hour + ":" + minute + " " + ampm;
 
 
var hour2 = document.getElementById('cbParamVirtual6').value;
 
if(hour2 =="")
 
hour2="00";
 
var minute2 = document.getElementById('cbParamVirtual8').value;
 
if(minute2 == "")
 
minute2 = "00";
 
var ampm2 = document.getElementById('cbParamVirtual7').value;
 
document.getElementById('InsertRecordEnd_Time').value = date + " " + hour2 + ":" + minute2 + " " + ampm2;
var start= new Date(document.getElementById('InsertRecordStart_Time').value);
var end = new Date(document.getElementById('InsertRecordEnd_Time').value);
var timeDiff = end - start;
var hh = Math.floor(timeDiff / 1000 / 60 / 60);
 
timeDiff -= hh * 1000 * 60 * 60;
 
var mm = Math.floor(timeDiff / 1000 / 60);
 
var totalmin= (mm+ (hh * 60)) ;
document.getElementById('InsertRecordTotal_Units').value =  (totalmin/60).toFixed(2);
 
};
 
 
</script>
Link to comment
Share on other sites

  • 0

Hello ababcock,

 

Maybe you can check these fields as "Required"?

Then a user cannot submit the record with not selected fields.

 

Or you can check values of the fields onsubmit, and if the value is "Loading..." deny the submitting.

 

Does it work for you?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...