Jump to content

JS to display message when 'Closed' selected in dropdown


Recommended Posts

Hi, very new to Caspio and would appreciate any assistance.

I need to generate a dialogue box when a dropdown is changed to a certain condition.

Dropdown field name is 'Status'. When 'Closed' is selected from dropdown I need a pop-up to appear and display a warning box along the lines of 'This job will be closed when form is submitted'. The box just needs an 'OK' as it's simply a warning to the user.

Thanks in advance

Kind regards

Mat

Link to comment
Share on other sites

You have this code in the footer of the submission page:

 

 



function show(){
var e = document.getElementById("InsertRecordDropDownFIELDNAME");
var strUser = e.options[e.selectedIndex].value;
if (strUser == "closed")
{alert("It will be closed.")
}
}
document.getElementById("InsertRecordDropDownFIELDNAME").onchange=show;


 

You need to replace "DropDownFIELDNAME" with the actual dropdown field name. And if it is an update or details page you need to replace "InsertRecordDropDownFIELDNAME" with "EditRecordDropDownFIELDNAME"

 

Good Luck   :P   :P   :P

Link to comment
Share on other sites

  • 2 weeks later...
  • 9 years later...
10 minutes ago, aquintanilla said:

Hi! Can I use a virtual in the " FIELDNAME"? Or does it has to be an actual field?

 

You should be able to. Instead of "InsertRecordFIELDNAME" you would do "cbParamVirtualNUMBER", where NUMBER is the number of the Virtual Field you are using (in the DP Wizard, they show up like Virtual12, you would use cbParamVirtual12).

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