Jump to content

autosubmit destination after record update to a specific page ,depending on a value


Recommended Posts

I have a Single Record Update data page, whit a autosubmit.

Depending on the value I want the  destination after record update  to a specific page.

Something like this.

<script>
var machtiging = "[@authfield:GEBRUIKERS_Machtiging]";

if(machtiging=="Yes")

  if(document.getElementById("caspioform")) 
{
  document.getElementById("caspioform").style.display = 'none';
  setTimeout('document.forms["caspioform"].submit()',1000); 
   window.location="[@app:logout]"; 
 }

else

  if(document.getElementById("caspioform"))
  {
  document.getElementById("caspioform").style.display = 'none';
  setTimeout('document.forms["caspioform"].submit()',1000); } 
 window.location="[@app:horseplanner_home]"; 
 }

</script>

This is not good ,i now. but  for  the idea.

does anyone have an idea:)

Link to comment
Share on other sites

Caspio handles destination upon submit.

Add the code for the desired redirect to a "Dispaly a Custom Message" option on the "Destination" page in the form editor.

Then you should be able to simplify your code

<script>
var machtiging = "[@authfield:GEBRUIKERS_Machtiging]";

if(machtiging=="Yes") {
   window.location="[@app:logout]"; 
 } else {
    window.location="[@app:horseplanner_home]"; 
 }

</script>

 

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
Reply to this topic...

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