Jump to content

Search the Community

Showing results for tags 'onchange'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Caspio Bridge
    • Caspio Apps for Ukraine
    • General Questions
    • Caspio JavaScript Solutions
    • Tables, Views and Relationships
    • Import/Export and DataHub
    • DataPages
    • Deployment
    • Security, Authentications, Roles, SAML
    • Styles and Localizations
    • Parameters
    • API and Integration
    • Calculations and aggregations
    • User JavaScript and CSS Discussions

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


MSN


Website URL


ICQ


Yahoo


Skype


Location


Interests

Found 7 results

  1. Hello, I have a field that normally would be a cascading radio button whose value is dependent on the selection of another field's dropdown value (the parent). However, I need the user to be able to over-ride the cascaded value occasionally. You can't do this normally so I'm trying to use js to do it. There is a text field set to Dropdown, called 'SalesCode.' A Virtual field (Virtual 18) is set to Cascading Text Field so it can receive a value when 'SalesCode' (the parent) is updated. The text field called 'Taxable' is the one I need to update. It's set to a Radio Button with 2 custom choices ('tax' or 'non'). The code I think I need is 'on change' for the SalesCode drop down field. Meaning when the user updates the SalesCode value, it updates Virtual18 (cascaded) and then the code takes the value of Virtual18 and puts in in the Taxable field's Radio Button value (the value in Virtual18 will always be either 'tax' or 'non' so it corresponds with the custom choices in Taxable). If the user wants to override that Taxable value they can change the radio button choice. The code below is something like I think I need but I can't get it to work, any help would be really great! <script> $("#InsertRecordSalesCode").change(function(){ var v_tax = document.getElementsByName("cbParamVirtual18")[0].value; document.getElementsByName("InsertRecordTaxable")[0].value = v_tax; }); </script>
  2. Hello, On a Details form, I have a text64000 field (uses Rich Text editor toolbar) to store an address value. This value can come from 3 different places, with different values from each, so, depending on which source the user chooses, I hide/show and use a virtual check box to run javascript on change, to paste a value from another virtual field into the text64000 field. <script> $("[name='cbParamVirtual19']").change(function(){ f_copy_print_address('cbParamVirtual22', 'cke_EditRecordItems_ShipAddress'); var v2 = document.getElementsByName("cbParamVirtual22")[0].value; }); $("[name='cbParamVirtual20']").change(function(){ f_copy_print_address('cbParamVirtual23', 'cke_EditRecordItems_ShipAddress'); var v2 = document.getElementsByName("cbParamVirtual23")[0].value; }); $("[name='cbParamVirtual21']").change(function(){ f_copy_print_address('cbParamVirtual24', 'cke_EditRecordItems_ShipAddress'); var v2 = document.getElementsByName("cbParamVirtual24")[0].value; }); </script> This will take the value from Virtual 22, 23, 24 (they are cascading virtual fields, hence the GetElementsByName) respectively and put it into the Items_ShipAddress field. This works fine in terms of getting the address value to show up in the Items_ShipAddress field. The problem is that when Updated this value is not saved (even though you can see it in the Items_ShipAddress field) UNLESS the user clicks into the Items_ShipAddress field and manually types in at least 1 letter (meaning they have to manually edit the field to save the value, the value the js puts in somehow doesn't 'stick'). I tried saving as a variable the values from Virtual 22, 23, 24 when they're generated (as you can see by that line of code above) and then using that variable to 'save' to the Items_ShipAddress field before Submit (code below). But it's not using the variable if/when the user changes the choice of which virtual checkbox to use (the on Change code). This is the code for before submit: <script type="text/javascript"> document.addEventListener('BeforeFormSubmit', function (event) { document.getElementById("EditRecordItems_ShipAddress").value = v2; }); </script> Any help would be really appreciated (I've tried using calculated values but haven't been able to get it to work for a number of reasons- I'd really just like the js to work).
  3. hello I am new to Caspio and really need a little help. I need to have my field Response updated when a date is added or changed to the field ServiceDate. The Response should be "New Date", "Updated Date" or null (if the value was not changed). ANy assistance would be greatly appreciated!!
  4. Having trouble trying to concatenate using onchange. the variables are derived from cascading dropdowns. Would like to see the concatenation results change as the dropdown selections are changed (this is all before submit on a form). <SCRIPT LANGUAGE="JavaScript"> function concatenate() { var one = document.getElementsByName("InsertRecordEmployee_Document_Title").value; var two = document.getElementsByName("InsertRecordEmployee_Document_ID").value; var link = (one+" "+ two); document.getElementsByName("InsertRecordEmployee_Document_Link")value = link; } document.getElementById("caspioform").onchange=concatenate; </SCRIPT> Also Tried: <SCRIPT LANGUAGE="JavaScript"> function concatenate() { var one = document.getElementsByName("InsertRecordEmployee_Document_Title")[0].value; var two = document.getElementsByName("InsertRecordEmployee_Document_ID")[0].value; var link = (one+" "+ two); document.getElementsById("InsertRecordEmployee_Document_Link")value = link; } document.getElementById("caspioform").onchange=concatenate; </SCRIPT> Unfortunately no luck. There is a report right above this form so I used the following which also didn't work: <SCRIPT LANGUAGE="JavaScript"> function concatenate() { var one = document.forms[2].getElementsByName("InsertRecordEmployee_Document_Title")[0].value; var two = document.forms[2].getElementsByName("InsertRecordEmployee_Document_ID")[0].value; var link = (one+" "+ two); document.forms[2].getElementsById("InsertRecordEmployee_Document_Link")value = link; } document.getElementById("caspioform").onchange=concatenate; </SCRIPT> Would really appreciate if anyone can guide me in the right direction. Thanks
  5. I'm trying to get some js to work with a Virtual field (currently set to a list box with 3 choices) when the selection changes (i.e. when the user clicks on choice 1,2,or 3 in the list of the Virtual field). I was able to get the rest of the code to work using a button but I'd like it to work directly when the user changes the selection in the listbox of the Virtual field. Here's what I've got so far. It's the onchange part I need help with: <div style="text-align: center;"> <script> $("[name='cbParamVirtual1']").change(function(){ var dtid = document.getElementsByName("cbParamVirtual1")[0].value; if (dtid == 1){ document.getElementById("InsertRecordMyField2").value = ""; document.getElementById("InsertRecordMyField3").value = ""; } else if (dtid == 2){ document.getElementById("InsertRecordMyField1").value = ""; document.getElementsByName("InsertRecordMyField3")[0].value = ""; } else if (dtid == 3){ document.getElementsByName("InsertRecordMyField1")[0].value = ""; document.getElementById("InsertRecordMyField2").value = ""; } } </script> </div> One thing also- I would prefer the Virtual field to actually be a real field (I couldn't get the var 'dtid' to work with a regular field though) that's a Radio button instead of a list- so that's the ultimate goal of this code. But just getting it to work with a Virtual field Listbox using 'change' would be a big help. Thanks- UPDATE: I am working through the process in steps on this datapage and just added virtual fields that use the MyField1,2,3 as the Parent fields for Cascading Text (on the Virtual field). This seems to disable the code above (perhaps because of the MyField1,2,3 is 'null' there can't be a cascade?). Any help with incorporating this into the code would be great as well.
  6. Hello all, I am currently working on a search form (using a virtual field submission form) that has a dropdown menu to select from predefined reports. The way I would like this to function is that when the user selects an option (such as "Recent (Within the Last 10 Days)") an onchange function would change the search fields to the input needed to produce those results. I am fairly new to JavaScript, here is what I have been able to get: <SCRIPT LANGUAGE="JavaScript"> function ocPredefinedReports() { if (document.getElementById("cbParamVirtual8").value=='Recent (Within the last 10 days)') { document.getElementById("cbParamVirtual5").value= 'Doe'; } } document.getElementById("cbParamVirtual8").onchange=ocPredefinedReports;</script>​ Through Google-Fu I was able to get a function working at one point that gave me ten days ago (Unfortunately I didn't save it anywhere!) but it was in the wrong format entirely. Any and all help is much appreciated, thank you. -Blue Edit: Sorry about the terrible title, time for more coffee.
  7. Hi, I have a form with 3 checkboxes. A visitor can select any checkbox to get the products they want: newspaper or magazine, both, or just one. --- The visitor can also select to get the e-newsletter, but only if the newspaper checkbox is selected. Else the e-newsletter checkbox is disabled (which is a rule set configured in the form that works fine). What I need.. is a function for if someone chooses both "newspaper" and "e-newsletter" checkboxes then decides that they don't want "newspaper" and deselect it (which leaves e-newsletter still checked). I need an onchange function that unchecks the "e-newsletter" checkbox at the exact same time newspaper is unchecked. Note - The exisitng rule makes the checkbox disabled and enabled, but it doesn't uncheck it. SAMPLE OF FORM: 1) [ ] Get this free newspaper /--> OC_news_print = id 1b) [ ] Get the e-newsletter too /--> OC_news_eletter = id 2) [ ] Get this different magazine -- SOMETHING LIKE CODE BELOW IS NEEDED - MINE / IT DOESN'T WORK --- <! -- vars NEEDED AT ALL ? var ocPrint = document.getElementById("InsertRecordOC_news_print"); var ocEnews = document.getElementById("InsertRecordOC_news_eletter"); --> function ocProductsCheck() { if (document.getElementById('InsertRecordOC_news_print').checked.length<1) { document.getElementById("InsertRecordOC_news_eletter").checked=false; } else { if (document.getElementById('InsertRecordOC_news_print').checked.length>0) { document.getElementById("InsertRecordOC_news_eletter").checked=false; } } document.getElementById("InsertRecordOC_news_print").onchange=ocProductsCheck; Thanks - Geoff
×
×
  • Create New...