Jump to content
  • 0

Embedding Same Datapage Multiple Times On Same Page


ababcock
 Share

Question

I have a datapage for mileage where staff enter the date, passenger, location from, location to, and number of miles. The passenger is an AutoComplete field that pulls from a table of clients, and the date has a calendar popup.

 

I am trying to deploy this multiple times on one site so that staff can enter more than one line at a time. I have embedded the code from Caspio three times, and the page shows up three times, but there are issues. The AutoComplete function and the calendar popup only work on the first form.

 

I hid the original submit buttons and found this script to submit multiple forms at once:

 

<script>
function submitallforms() {
setTimeout('document.forms[0].submit()',100);
setTimeout('document.forms[1].submit()',200);
setTimeout('document.forms[2].submit()',300);
}
// End -->
</script>

<input type=button value="Submit" onclick="submitallforms();">

 

When I submitted mileage in all three rows, only the data entered in the first and third form showed up on my table -- nothing from row/form 2 came through. Below is everything I have entered for this page:

 

<!DOCTYPE html>
<html lang="eng">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
 
<div id="cbc57e3000b2753cfd2eae4f80a3c7"><a href="http://www.caspio.com" target="_blank">Online Database</a> by Caspio</div>
<script type="text/javascript" src="https://c0gfs461.caspio.com/scripts/embed.js"></script>
<script type="text/javascript">try{f_cbload(true, "c0gfs461.caspio.com", "c57e3000b2753cfd2eae4f80a3c7");}catch(v_e){;}</script>
<div id="cxkg"><a href="https://c0gfs461.caspio.com/dp.asp?AppKey=c57e3000b2753cfd2eae4f80a3c7">Click here</a> to load this Caspio <a href="http://www.caspio.com" title="Online Database">Online Database</a>.</div>
 
<div id="cbc57e3000b2753cfd2eae4f80a3c7"><a href="http://www.caspio.com" target="_blank">Online Database</a> by Caspio</div>
<script type="text/javascript" src="https://c0gfs461.caspio.com/scripts/embed.js"></script>
<script type="text/javascript">try{f_cbload(true, "c0gfs461.caspio.com", "c57e3000b2753cfd2eae4f80a3c7");}catch(v_e){;}</script>
<div id="cxkg"><a href="https://c0gfs461.caspio.com/dp.asp?AppKey=c57e3000b2753cfd2eae4f80a3c7">Click here</a> to load this Caspio <a href="http://www.caspio.com" title="Online Database">Online Database</a>.</div>
 
<div id="cbc57e3000b2753cfd2eae4f80a3c7"><a href="http://www.caspio.com" target="_blank">Online Database</a> by Caspio</div>
<script type="text/javascript" src="https://c0gfs461.caspio.com/scripts/embed.js"></script>
<script type="text/javascript">try{f_cbload(true, "c0gfs461.caspio.com", "c57e3000b2753cfd2eae4f80a3c7");}catch(v_e){;}</script>
<div id="cxkg"><a href="https://c0gfs461.caspio.com/dp.asp?AppKey=c57e3000b2753cfd2eae4f80a3c7">Click here</a> to load this Caspio <a href="http://www.caspio.com" title="Online Database">Online Database</a>.</div>
 
<footer>
<script>
function submitallforms() {
setTimeout('document.forms[0].submit()',100);
setTimeout('document.forms[1].submit()',200);
setTimeout('document.forms[2].submit()',300);
}
// End -->
</script>
 
<input type=button value="Submit" onclick="submitallforms();">
 
</footer>
</html>
 
Can anyone help me figure out how to get this to work?
 
Thanks!
Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

I have an idea for a workaround.

Use a Report DataPage to show the logged trips. Then use a popup to add additional trips. This way the driver can see everything they've previously added while adding the latest trip.

 

You can see this in action by registering for access to my app, ezIQ, at www.effortlessIQ.com/info#try

 

Hope this helps!

Link to comment
Share on other sites

  • 0

Hi ababcock,

 

Do you want to add three records?

You can copy the DataPage two times and to deploy three different DataPages that use the same DataSource. Does it work for you?

 

If you want to add three passengers to the same record, you can edit your table and create three DataPages that use the same table or view, but work with different fields. There is the article how to create a multi-step form.

 

I apologize, if I understand you wrongly.

Link to comment
Share on other sites

  • 0

Thanks for getting back to me, Jan. I have seen a few people reference the ability to "add a line" as you go, and that's what I would like to do. On the submission form, the user should see the first line where they can input the passenger name, locations, date, and distance. Then, they should be able to add another trip if they have two to enter and so on. 

 

I did try copying the embed code and pasting it three times into my page. This made the submission form appear three times, but the 2nd and 3rd ones weren't fully functional (the autoComplete and calendar popup didn't work). Also, for this I installed a "Submit All" button, which ended up only submitting information from the 1st and 3rd forms. The final problem I had with this solution was that it would submit all the forms, blank or not, so I ended up with extra lines in my table that didn't need to be there. Those would add up pretty quickly when in regular use.

 

I looked at the multi-step form link, and I don't think that's what I'm going for. I don't have a large number of different fields in this case; I just want the user to be able to submit multiple lines in a few fields at the same time.

 

Any suggestions?

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...