Jump to content


  • Posts

  • Joined

  • Last visited

h8windows's Achievements


Newbie (1/14)



  1. I think your syntax may be screwing it up. try: <SCRIPT LANGUAGE="JavaScript"> function confirmation() var confirm = document.getElementById("EditRecordBIZ_appointments_Appointment_Confirmation").value; { if (confirm == "yes") { document.getElementByID("EditRecordBIZ_appointments_Appointment_Status").value="Confirmed"; } } document.getElementByID("caspioform").onsubmit=confirmation; </SCRIPT> The backslash is used to escape quotes, so it was probably choking there. Also, by NOT having quotes around yes, javascript assumes that yes is a variable, which in your case it is not.
  2. In my case, I was OK with using a dropdown menu for data entry, as the selection would only be temporary or permanent. (The item could never be both). But in the search page, a user may want to search for either or both, and checkboxes would be much more user friendly. In Configure Search Fields select the DataPage Element, and make it a listbox with comparison type of equal. Make the source a lookup and select the table. Create a new HTML Block under that Element, and paste the following: <label>Permanent</label> <input type="checkbox" id="checkbox0" onClick="changeSelect('0')"> <label>Temporary</label> <input type="checkbox" id="checkbox1" onClick="changeSelect('1')"> You can easily add to this if your input listbox contained something like "semi-permanent". Below the HTML Block, create a new Footer, and paste the following: <script type="text/javascript"> var pushVal = document.getElementById('Value5_1'); pushVal.style.display = "none"; function changeSelect(value) { var box0State = document.getElementById('checkbox0').checked; var box1State = document.getElementById('checkbox1').checked; if (value == 0 && box0State == true || value == 1 && box1State == true) { pushVal[value].selected = true; }else{ pushVal[value].selected = false; } } </script> This is pretty easy to extend as well. If you added a checkbox with id of 'checkbox2' in the HTML, just write a new var box2State line, add " || value == 2 && box2State == true" to the if statement and you're done. Note in the above code that the id of my listbox is Value5_1, which I'm hiding from the user and also populating its values through the checkbox handlers. You will need to change that id to the id Caspio Bridge assigns to your particular element. Maybe this will keep someone out there from a few hours of head scratching.
  • Create New...