Jump to content

TWIRED

Caspio Ninja
  • Posts

    81
  • Joined

  • Last visited

  • Days Won

    1

TWIRED last won the day on December 28 2016

TWIRED had the most liked content!

About TWIRED

  • Birthday May 7

Recent Profile Visitors

2,922 profile views

TWIRED's Achievements

  1. If its a result page, You could put the code below in the header(Source) authentication needs to be enabled. change the "http://.." to the appropriate URL. Hope this helps.. <div id="myDiv1"></div> <SCRIPT LANGUAGE="JavaScript"> var myDiv1 = document.getElementById("myDiv1"); var branchtype ='[@authfield:Staff_List_Branch_Type]'; //alert(branchtype); if (branchtype=='FS') { myDiv1.innerHTML = "<b><h3><a href=\"http://www.google.com\">Google</a></hr></b>"; } else if (branchtype =='SIS') { myDiv1.innerHTML = "<b><h3><a href=\"http://www.amazon.com\">Amazon</a></hr></b>"; } </script>
  2. Hey abelphathot, this might help.. In your original post, if its a checkbox <SCRIPT LANGUAGE="JavaScript"> function Updatestatus(){if (document.getElementById("approved").checked==true){document.getElementById("status")="approved";}else if (document.getElementById("approved").checked==false){document.getElementById("status")="pending";}document.getElementById("caspioform").onsubmit= Updatestatus; </SCRIPT> you need to change to function Updatestatus(){if (document.getElementById("approved").checked=true);{document.getElementById("InsertRecordstatus")="approved";}else if (document.getElementById("approved").checked=false);{document.getElementById("InsertRecordstatus")="pending";}document.getElementById("caspioform").onsubmit= Updatestatus; </SCRIPT> change from "==" to = and you were also missing some semicolons Best ~
  3. Thanks for taking the time ! Will try the site account settings in the URL format. finally figured out what the problem is after many hours of messing around . Heres what I found out Exampleoriginalimage.jpg (path) is stored in table 1 (file field)lets say fileID is : 0000If the filefield is set to : Upload New File / (Automatically create a unique name) And,If a user uploads a file with the SAME NAME ,originalimage_1.jpg is created but the Original Image fileID NOW will change : originalimage.jpg : 0001 << increased by1 and changedoriginalimage_2.jpg : 0002 This was what was breaking the URL https://c2eku181.caspio.com/dpImages.aspx?AppKey=xxxxxxxxxx&file=/IMAGES_/TRIPATWORK/TESTIMAGES/spiderman.jpg so basically the URL becomes invalid , because it is tied to the fileID of the image.when the fileid changes, the url cannot find the image because it is still tied to the original file id Thanks for the zapier tip, will try it out and seems like a great way to store images with aws.. Best !!~
  4. These type of urls , used to work flawlessly https://c2eku181.caspio.com/dpImages.asp?AppKey=ff384000f093d12f0cad40eab055&file=/IMAGES_/TRIPATWORK/TESTIMAGES/spiderman.jpg Last night it stopped working. it gives "File or Directory Not Found" error We use this type of display of images a lot with our apps. any idea why??? Update It seems to be something to do with the fileID changing. If a field is set to : Upload New File / (Automatically create a unique name) 1) a user uploads a file abc.jpg the first time.2) when the user uploads a file :- again with the same name,The URL link to the original abc.jpg does not work - because the fileid changes.Im assuming this happens because at caspios backend , the fileid is referred to when the url is parsed.
  5. Thanks Mathilda, ".. a separate table for history of logs and then create a submission form and receive user's ID and other datapa from authentication fields, then add auto-submit script. After that, you may specify in authentication to redirect user to that datapage and then after form is submitted, redirect user to the user's dashboard. " it worked
  6. Just some pointers:) ---------------------------- 1) One cannot copy a file or image to another table, just by code on the front end (lets say javascript) . Its because of security reasons its disallowed. There has to be user intervention (choose and submit) by the user to do that. 2) in caspio, images/files are not actually stored in the table, A file or image is actually stored in a folder (>> All Assets , Click on Files) >> ONLY a URL Link or path to the file is stored in the table field So basically , you dont need to "copy" the image over. *if you want to, you can copy the path to the image, in another tables field . The copied-to field must be a text field. After Submission of the saved image, whenever you want to reference the image , do so with a view (which has both tables) So if you create a relationship/Join between the 2 tables. ------------------------------------------------------------------------------------------- Table 1 Table 2 Table1ID (autonumber) Table2ID (autonumber) Table1FKID (Integer) << Foreign Key Join Table1 (Table1ID) >>One to Many >> Table2 (Table1FKID) Create a View ------------------------ Inner Join Table1 (Table1ID) >>One to Many >> Table2 (Table1FKID) Results or Report data Page (Referencing the saved image from Table 1 : in reports from other tables) --------------------------------------------- Use the View above as Data Source. Heres a working demo http://www.tripatwork.com/tagnt-test-2.html If you need any help, let me know...:) Thanks !
  7. HI Diversity, As Mathilda mentioned, you have to hit "Source" button (in footer) and then paste the code in. Also, Hold down Control key when selecting from the listbox.
  8. This might work.... Create a View with Both Tables - the table/field that will be updated , make editable Choose the view as datasource in the submission form Use the Resizer option in File Field Name , give it the field name you want to copy to. And, Instead of giving resized options, you could just give it the same width and height as the original. attached pic below.
  9. Hi Diversity, If yourlistbox field name is say, "LSTBOX", then you need to :- change it at both places in the script , in your submission form (in footer - configure fields section) to InsertRecordLSTBOX If its an update form then change to EditRecordLSTBOX Destination of Submission form : Same Form Heres a live working example: http://www.tripatwork.com/test-multilistbox-submit.html also attached is my settings for the listbox field element It definitely works, and it works well ! Hope this helps:) Thanks
  10. This might help... Pure JS http://stackoverflow.com/questions/28545509/display-image-thumbnail-of-image-selected-from-filepicker http://stackoverflow.com/questions/23598175/thumbnail-image-that-pop-when-selected-javascript JQuery/Lightbox Method http://www.lokeshdhakar.com/projects/lightbox2/?u=9
  11. This seemed to work for me. After messing around with it a bit. The trick in the submit form , the destination , do not use "Same Form" opton Use "Go to New Page" and enter the URL of the results datapage Also.. In the Submit form ---------------------- add < ahref="url?cbResetParam=1 > New Search</a> in Header destination : url of results page ( do not use "same Form" option !!) in dropdowns , make sure the onload external parameters is checked and entered. This will keep the drop downs in place after every submission. results page do not add search form links in results and details wizard options, leave it blank
  12. Just wanted to share this. Hope it helps somebody. solution to change the value of a label of a particular element in a form (Javascript): ------------------------------------------------------------------------------------------------------------ var labels = document.getElementsByTagName('label'); // 'label' is passed as the argument. To get this argument, First inspect the form element TYPE name in Chrome. for (var i = 0; i < labels.length; i++) { if (labels.htmlFor != '') { var elem = document.getElementById(labels.htmlFor); if (elem) elem.label = labels; } } document.getElementById('EditRecordDummyCount').label.innerHTML = 'Label text is changed';
  13. What I was looking to do was : change the value of a label (of a particular element) in a form. figured it out. Thanks ! Qtn : Using Javascript, is it possible to change the value of a >> Virtual Field ? If so, How ???? solution to change the value of a label of a particular element in a form: ------------------------------------------------------------------------------------------------------------ var labels = document.getElementsByTagName('label'); // 'label' is passed as the argument. To get this argument, First inspect the form element TYPE name in Chrome. for (var i = 0; i < labels.length; i++) { if (labels.htmlFor != '') { var elem = document.getElementById(labels.htmlFor); if (elem) elem.label = labels; } } document.getElementById('EditRecordDummyCount').label.innerHTML = 'Label text is changed';
  14. Just my 2 cents, maybe a shared table , with the parameter values? can then be used witha view or as a lookup table? Thanks
×
×
  • Create New...