Jump to content

roelmagpoc

Members
  • Posts

    11
  • Joined

  • Last visited

roelmagpoc's Achievements

Newbie

Newbie (1/14)

2

Reputation

  1. My code is working now by combining all the examples above and using getElementsByName as you suggested. The big thing I was missing was defining the function and running it when needed. Also, i thought "caspioform" needed to be changed to my actual form name. Thanks!
  2. I'm curious on how you solved it - did you just add additional Attachment fields? Or you found something better? One thing I did before was use a separate Attachments table, using a key field as relationship between the primary table and the attachments.
  3. Jan - I'm trying to follow this to create my login-redirect page. In my case, my users table has a field called WFMAcessLevel, which contains either 1 or 2. So I created an HTML page with the codes below and authenticated that HTML page. <script> if("[@authfield:WFMAccessLevel]" == "1"){ window.location = "http://b6.caspio.com/dp.asp?AppKey=b9443000efaa7d4f8894459cadfc"; } else ("[@authfield:WFMAccessLevel]" == "2"){ window.location = "http://b6.caspio.com/dp.asp?AppKey=b94430003cfd158680bc46e8877b"; } </script> It's not redirecting - just giving me a blank screen. Am I doing this right? Or I really need to define Admin and Staff as Yes/No in my table?
  4. Thanks Luis & Jan! I have a working code now. Major lesson learned: define the function and run it upon submit. I did not do this the first time so my codes were not working.
  5. Luis - [@fieldWorkOrderDetail] is a dropdown datafield in my submission form. (The codes I'm using I based from your other posts.) Jan - I tried defining the variables but they still don't work. Here was my original script (I actually just copy codes from this forum; I'm really not a JS programmer). I tried using both getElementById and getElementsByName. When I include the prefix "InsertRecord", I get a "404-File not found" error. <script type="text/javascript"> { var x = document.getElementsByName("WorkOrderType"); var y = document.getElementsByName("WorkOrderDetail"); if (y == 'M1 TDM') {document.getElementById("cbParamVirtual1").value = "http://b6.caspio.com/dp.asp?AppKey=b9443000bc1de4154c364d53a0b5";} else if (y == ‘M1 Fiber’) {document.getElementById("cbParamVirtual1").value = "http://b6.caspio.com/dp.asp?AppKey=b94430008aaa7fbc77eb48df83f8";} else {document.getElementById("cbParamVirtual1").value = "http://b6.caspio.com/dp.asp?AppKey=b9443000fa23580f2eda4a41bb40";} } </script>
  6. I need to redirect using a virtual field depending on a datafield value. The virtual field will be assigned the link depending on the WorkOrderDetail. The redirect will happen afer submitting the form. I am also passing an autonumber field called the WorkOrderId. I’m able to pass the autonumber correctly when redirecting, however, my criteria (the if-condition) is not working properly. Here’s my current script which I placed in the footer - it always goes to the “else†part even when it should satisfy the if criteria.(I plan to add more criteria but need to make the script work first.) <script type="text/javascript"> { if ("[@field:WorkOrderDetail]" == "M1 TDM") {document.getElementById("cbParamVirtual1").value = "http://b6.caspio.com/dp.asp?AppKey=b9443000bc1de4154c364d53a0b5";} else {document.getElementById("cbParamVirtual1").value = "http://b6.caspio.com/dp.asp?AppKey=b9443000fa23580f2eda4a41bb40";} } </script> Hope you guys can help.
  7. Can you help me with this script? I created a hidden virtual field (Virtual1) that should contain my links below based on given conditions. Then, I want to use that Virtual1 field to redirect the user upon form submission. I tried putting the codes in an HTML block then in the Footer but it seems like the Virtual1 field is not getting any value. Please help. <script type="text/javascript"> var WorkOrderType = '[@field:WorkOrderType]'; var WorkOrderDetail = '[@field:WorkOrderDetail]'; if (WorkOrderDetail == 'M1 TDM') { document.getElementById("cbParamVirtual1").value = "http://b6.caspio.com/dp.asp?AppKey=b9443000bc1de4154c364d53a0b5&WorkOrderId=[@field:WorkOrderId]"; } Else if (WorkOrderDetail == 'M1 Fiber') { [@Virtual1]="http://b6.caspio.com/dp.asp?AppKey=b94430008aaa7fbc77eb48df83f8&WorkOrderId=[@field:WorkOrderId]"; } Else { [@Virtual1]="http://b6.caspio.com/dp.asp?AppKey=b9443000fa23580f2eda4a41bb40&WorkOrderId=[@field:WorkOrderId]"; } </script>
  8. Is there a way to validate data entered without the use of dropdowns and cascading dropdowns? e.g. If a Site ID entered is not part of the related table, then error message after data entry or restricted during submission of record.
×
×
  • Create New...