thirdcircle Posted May 22, 2010 Report Share Posted May 22, 2010 OBJECTIVE: On DataPage 1 (embedded deploy), the user is presented with a check box (Question_1). After clicking Sumbit on DataPage 1, user is directed to DataPage 2 (embedded deploy). If the user checked the checkbox on DataPage 1, then DataPage 2 should display a hidden text field. ISSUE: I cannot get the text field to display on DataPage 2. CASPIO DESIGN: My table has a YES/NO field called "Question_1" On DataPage 1 (update existing record, embedded deploy), Question_1 is included as a Checkbox form element and is set to pass the field value to the next page. On DataPage 2, (update existing record, embedded deploy), Enable Advanced Options and Enable Parameters are both enabled. A Unique Field ID and Parameter Name are defined [@InsertRecordxxxx].An HTML block is defined in the header (I've also tried it in a body HTML block) that contains the following: window.onload=function visibleInvisible() function visibleInvisible() { if("[@Question_1]"="YES") { form.visibleTxtBox1.style.visibility="visible" } else { form.visibleTxtBox1.style.visibility="hidden" } } Any help you could provide would be appreciated. Thanks. Quote Link to comment Share on other sites More sharing options...
sbelini Posted May 24, 2010 Report Share Posted May 24, 2010 Hi, If you are referencing a parameter from a Webform inside javascript, you should use "[@PARAMNAME]" (quotes included) where PARAMNAME is the name of the parameter passed. Given that, you can hide/display the fields you wish. Regards, sbelini. Quote Link to comment Share on other sites More sharing options...
thirdcircle Posted May 25, 2010 Author Report Share Posted May 25, 2010 sbelini, Thanks for the info but, unfortunately, that doesn't resolve the issue. Quote Link to comment Share on other sites More sharing options...
sbelini Posted May 25, 2010 Report Share Posted May 25, 2010 Hi, I merely explained how to read a Caspio parameter within javascript. There are several other issues with your script: 1) window.onload=function visibleInvisible() My guess is that you are trying to call the visibleInvisible function when the form loads. In this case try: window.onload = visibleInvisible; 2) always end a line with a ";" 3) form.visibleTxtBox1.style.visibility - that's not how you reference an object in Caspio. Try getElementByID or getElementsByName. 4) you are using nested forms: Caspio forms are forms themselves and nested forms are not allowed in HTML. You can find information about javascript syntax and semantics as well at http://www.w3schools.com and many other sites. In addition, using the firebug add-on on Firefox, will greatly help you in debugging your code. sbelini. Quote Link to comment Share on other sites More sharing options...
thirdcircle Posted May 25, 2010 Author Report Share Posted May 25, 2010 Again, thanks for the info and the help. My script still is not working. The current version is: script type="text/javascript"> var q1; q1 = "[@Question_1]"; window.onload = visibleInvisible(q1) function visibleInvisible(q1){ if (q1 =="Y") {document.getElementById("EditRecordQuestion_1_info").style.visibility="visible";} else {document.getElementById("EditRecordQuestion_1_info").style.visibility="hidden";} } Quote Link to comment Share on other sites More sharing options...
bahar_vm Posted June 4, 2010 Report Share Posted June 4, 2010 I see some syntax errors on the code, for example " I suggest you using Firefox browser where you can add on Firebug tool. Firebug enables you to see the errors in your page when the page runs and this way you can debug your code as it tells you which line is problematic. Caspio also has Professional Services department for the custom development purposes. If you are interested to get a quote you can fill out the custom development form at http://www.caspio.com/services/custom-a ... opment.asp. Another note, I recommend using a Caspio input field instead of putting using custom input field in your code as in . Hope this helps. Bahar M. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.