Jump to content

Buggy

Members
  • Posts

    14
  • Joined

  • Last visited

Buggy's Achievements

  1. yes so when page loads the dropdown is selected and radiobutton is selected from value set previosly in the database but the js is setting radiobutton to "active" regardless. i only want it to do that if the value of the dropdown is changed by the user.
  2. i have this code and want it to set radioButtonActive.checked = 'checked'; only when page changes not when its initially created but i think because it relates to the value of a cascading dropdown its is set top active everytime apart from if is true. how could i achieve this ? <script> if (document.DataPageReadyHandler == undefined) { const DataPageReadyHandler = (e) => { if (e.detail.appKey != '[@cbAppKey]') { return } const dropdown = document.querySelector('select[id*="EditRecordMW_Watch_Work_Work_Progress"]'); const radioButtonComplete = document.querySelector('input[id*="EditRecordMW_Watch_Work_Work_Status"][value="Complete"]'); const radioButtonActive = document.querySelector('input[id*="EditRecordMW_Watch_Work_Work_Status"][value="Active"]'); dropdown.addEventListener('change', (e) => { if (e.target.value == '2'|| e.target.value == '12' || e.target.value == '21' || e.target.value == '113' || e.target.value == '116') { radioButtonComplete.checked = 'checked'; } else { radioButtonActive.checked = 'checked'; } }) } document.addEventListener('DataPageReady', DataPageReadyHandler) document.DataPageReadyHandler = 'Enabled' } </script>
  3. i have this code which is great but when the page loads because its using cascading dropdown - radioButtonActive.checked = 'checked'; gets set everytime on the esle statement and i want it only if the user has changed the value here - mconst dropdown = document.querySelector('select[id*="EditRecordMW_Watch_Work_Work_Progress"]'); <script> if (document.DataPageReadyHandler == undefined) { const DataPageReadyHandler = (e) => { if (e.detail.appKey != '[@cbAppKey]') { return } const dropdown = document.querySelector('select[id*="EditRecordMW_Watch_Work_Work_Progress"]'); const radioButtonComplete = document.querySelector('input[id*="EditRecordMW_Watch_Work_Work_Status"][value="Complete"]'); const radioButtonActive = document.querySelector('input[id*="EditRecordMW_Watch_Work_Work_Status"][value="Active"]'); dropdown.addEventListener('change', (e) => { if (e.target.value == '2'|| e.target.value == '12' || e.target.value == '21' || e.target.value == '113' || e.target.value == '116') { radioButtonComplete.checked = 'checked'; } else { radioButtonActive.checked = 'checked'; } }) } document.addEventListener('DataPageReady', DataPageReadyHandler) document.DataPageReadyHandler = 'Enabled' } </script>
  4. i figured it was using another value in the dropdown for the value.
  5. hi what am i looking for in the console please ? i can see Uncaught SyntaxError: Unexpected token '{' at addScriptElem (<anonymous>:5:6358) at Array.forEach (<anonymous>) at f_tabularRSViewObj.parseResponse (<anonymous>:5:5822) at ajaxObj.callBack (<anonymous>:20:5572) at xmlhttp.onreadystatechange (<anonymous>:10:2190)
  6. im still trying to implement this code but i cannot get the result i hoped for can anybody help further with this ?
  7. ok the trigger will only work after the page is submitted ? im trying to update the page on the fly and normalyy i manage this with my limited knowledge of js but struggling here, its still not working?
  8. what is this bit doing in your code - if (e.detail.appKey != '[@cbAppKey]') { return }
  9. ok still not working. the value when opened is 'Started' and RadioButton has 3 choices and Active is checked When value is changed to 'Done' i want RadioButton 'Complete' to be checked so when page is updated these are written to table.
  10. hi im trying to change value of a radiobutton when a change the value o a dropdown using the following script. can anybody help here please ? <script> if (document.dataPageReadyHanlder == undefined) { const dataPageReadyHanlder = () => { const radioButton = document.querySelector("[id*='EditRecordMW_Watch_Work_Work_Status']"); const dropdowns = document.querySelectorAll('input[name="EditRecordMW_Watch_Work_Work_Progress"]'); if(radioButton == null) return; for (const dropdown of dropdowns) { dropdown.addEventListener('change', (e) => { console.log(e.target.value); if (e.target.value == 'Done') { radioButton.value = 'Complete'; } else { radioButton.value = 'Active'; } }); } }; document.addEventListener('DataPageReady', dataPageReadyHanlder); document.dataPageReadyHanlder = dataPageReadyHanlder; } </script>
  11. Yes external website i cannot change but want to get data into caspio
  12. I have a webform and wish to import the created fields to a table inside caspio. i know i can use zapier etc but i am trying to avoid the extra cost of these features. Has anybody done this by passing parrameters in urls ?
  13. hi i have this code in my header when i add an NEW item on a submission form <script> document.addEventListener('DataPageReady', ()=> { const virtualF = document.querySelector('[name="cbParamVirtual5"]') virtualF.addEventListener('change', (e)=>{ document.querySelector('#EditRecordDescription').value = e.target.value }) }) </script> on my EDIT item page i only want to fire if a button is clicked, can anybody help ?
×
×
  • Create New...