Jump to content

Check field before auto submit


Recommended Posts

Hi there,

I am using the standard autosubmit script to send users to one form using parameters to auto fill it and autosubmit it and then on to another form.  However some users get stuck in a loop if a field in the first autosubmit form are already in the table, and they never get to the second form and don't see the error message.

Is there a way to write into this script "if field already exists in table [users] DO NOT autosubmit, instead show an error message?  

<script type="text/javascript">
  if(document.getElementById("caspioform")) {
  document.getElementById("caspioform").style.display = 'none';
  setTimeout('document.forms["caspioform"].submit()',1000); } 
</script>

Many thanks
Nikki

Link to comment
Share on other sites

You can setup the autosubmit datapage to filter, and receive a value passed from referring page. The value would be a check value and you can create a calculated field to pass the check value to the auto submit datapage. Then for the auto submit datapage, update it's localization to display the custom message if it fails the filter condition.

Link to comment
Share on other sites

Create a copy of your Localization under Text >> Messages >> 351 No records found change it to custom and ass script to redirect user:

 

<script> window.location= 'URL to autosubmit?email=[@email]';</script>

You need to pass the values you want to receive in your submission form through this link .

 

Create a details page which is filtered by the unique value which is now preventing users from submit. Use that Localization for this details page. If account is already in the database it will show the details of that if not then it will be redirected to auto submit form.

 

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...
×
×
  • Create New...