Jump to content

Search the Community

Showing results for tags 'javascript'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Caspio Bridge
    • 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

  1. Hi @abelphathost, Thanks for the message, but let's not ask questions privately.... the point of a forum is for people to find that somebody else has already asked the same question. A couple things to note 1 - I've had trouble using JS and Caspio's checkboxes. Dropdowns are easier to work with. 2 - I never use 'onsubmit'. Rather i create a fake submit button that runs that code I need before the submit happens then wrap the function with: document.getElementById("Submit").click() ** If you must have something easier than a dropdown... This takes some work, but will allow you to do it. HTML block <style> #YOUR_FIELD_ID {display: none} .fake-radio { width: 120px; height: 50px; padding: 16px; margin: 16px 0 0 32px; font-size: 18px; float: left; } </style> <div class="fake-radio" onclick="document.getElementsByName('YOUR_FIELD_ID')[0].value = 'Yes';>Yes</div> <div class="fake-radio" onclick="document.getElementsByName('InsertRecordFieldName')[0].value = 'No';>No</div> YOUR_FIELD_ID 1. right click the field you want to populate > inspect 2. Look for <xx class="sample" id="XYZ_98sd7d" name="InsertRecordYOURFIELDNAME">Hi World</xx> 3. your answer is InsertRecordYOURFIELDNAME Try these suggestions and I'm sure you'll find your solution
  2. Hi everybody, i need to update a field i the database when a checkbox is checked here is my code but it's not working: <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")="pend"; } document.getElementById("update as").onsubmit= UpdateQty; </SCRIPT>
  3. Hi, My current code is: <SCRIPT LANGUAGE="JavaScript"> function update() { var p2 = document.getElementById("cpParamVirtual10").value; document.getElementByName("cpParamVirtual4")[0].value=p2; } document.getElementByID('caspioform').onload=update; <SCRIPT> and I have it deployed in the footer of a submission form however it is not working. Virtual10 is a hidden field that loads with a passed parameter . Virtual4 is a cascading dropdown ( and on exit passed the parameter that virtual10 loads). I want to set the cascading dropdown to the value it was when the form was submitted the last time instead of resetting itself every time. Thanks for the help.
  4. When one of my end users fills out a form then need to use the barcode scanner. An example of the text would be "%247463$1$0$4$20%". My script below is suppose to extract everything after the first two characters up to the last character. It works but it is also showing the original along with it. <script> function modify() { //Store the value in the field to trim. var trim = document.getElementsByName("InsertRecordBarcode")[0].value; //Take a substring of trim and store it back into new trim value. trim = trim.match("%2(.*)%"); //Set the value of the weight field in the form to the new substring document.getElementsByName("InsertRecordBarcode")[0].value = trim; //the new value in the field is what is submitted. } //When the form is submitted called method modify. document.getElementById("caspioform").onsubmit=modify; </script> My result showing is "%247463$1$0$4$20%,47463$1$0$4$20". What am I doing wrong as I want it to only show the 47463$1$0$4$20. thank you.
  5. Hi! I have multiple scripts for a submission page. When I execute the page I am only able to get one to work at a time. Not all three. I am not sure what I am doing wrong. Any help or advice would be appreciated. I have pasted the scripts below. I have all the scripts in the footer of the page. The first simply checks that the MOQ field is greater than the Inner Pack field. The second checks that cost is less than retail. They third, if the virtual check box is checked, it will copy the data from the Vendor VPN field to the Vendor Style field. <SCRIPT LANGUAGE="JavaScript"> function check() { var v_moq = parseFloat(document.getElementById("InsertRecordMOQ").value); var v_innerpack = parseFloat(document.getElementById("InsertRecordINNERPACK").value); if(v_moq<v_innerpack) { window.alert("MOQ Must Be Less Than The Inner Pack"); return false; } } document.getElementById("caspioform").onsubmit=check; </SCRIPT> <SCRIPT LANGUAGE="JavaScript"> function check() { var v_cost = parseFloat(document.getElementById("InsertRecordCOST").value); var v_retail = parseFloat(document.getElementById("InsertRecordRETAIL").value); if(v_cost>v_retail) { window.alert("Vendor Cost must be less than Retail"); return false; } } document.getElementById("caspioform").onsubmit=check; </SCRIPT> <script> function f_vendorstyle() { if(document.getElementById('cbParamVirtual1').checked) { document.getElementById('InsertRecordVENDORSTYLE').value=document.getElementById('InsertRecordVENDORVPN').value; } else { document.getElementById('InsertRecordVENDORSTYLE').value=""; } } document.getElementById('cbParamVirtual1').onclick= f_vendorstyle; </script>
  6. So this is something that has been addressed a couple of different times but not of the Javascript solutions work for me. I have an update page that has 3 listboxes with multi-select enabled. I need the update page to display the multiple selections in the listbox separately and not in one long sentence separated by commas. Here are two of the different scripts I have tried to use, neither has worked. First: <script> // Function for selecting corresponding elements from the list box. function select_ (){ // get listbox element var o_els = new Array("EditRecordStatus","EditRecordMarket_Sector","EditRecordDivisions"); for (var k=0; k< o_els.length; k++ ) { var o_el = document.getElementById(o_els[k]); // Enable multiselect for listbox o_el.multiple="multiple"; // get listbox length var len = o_el.options.length; // get selected element var selected = o_el.options[len-1].value; // verify if selected element contains comas, if yes, do the following if (selected.indexOf(",") != -1 ){ // Split selected option into array var m_array = new Array();m_array=selected.split (","); // Delete last option from the listbox o_el.options.remove(len-1); // Go through listbox and select each option, if it is present in array for( var i=0; i< m_array.length; i++ ){for( var j=0; j< len-1; j++ ){ // Trim spaces while comparing elements from array and listbox if( m_array.replace(/^s+|s+$/g, '') == o_el.options[j].value ){ o_el.options[j].selected = "selected"; } } } } } } // call select_ funtion when details page is loaded window.onload = select_; </script> Second (On this one the 3rd Listbox works but the other two do not): <script type="text/javascript"> var v_state = "[@field:Status]" ; var o_state = document.getElementById("EditRecordStatus") ; o_state.multiple = true ; function f_listbox() { if ( v_state.indexOf(",") > 0 ) { for (var i=0 ; i < o_state.options.length; i++ ) { if(o_state.value == v_state) { o_state.remove(i); break ; } } var o_st = v_state.split(", ") ; for (var j=0 ; j < o_st.length; j++) { for (var i=0 ; i < o_state.options.length; i++ ) { if(o_st[j]== o_state.options.value){ o_state.options.selected = true ; break ; } } } } } window.onload = f_listbox ; </script> <script type="text/javascript"> var v_state = "[@field:Market_Sector]" ; var o_state = document.getElementById("EditRecordMarket_Sector") ; o_state.multiple = true ; function f_listbox2() { if ( v_state.indexOf(",") > 0 ) { for (var i=0 ; i < o_state.options.length; i++ ) { if(o_state.value == v_state) { o_state.remove(i); break ; } } var o_st = v_state.split(", ") ; for (var j=0 ; j < o_st.length; j++) { for (var i=0 ; i < o_state.options.length; i++ ) { if(o_st[j]== o_state.options.value){ o_state.options.selected = true ; break ; } } } } } window.onload = f_listbox2 ; </script> <script type="text/javascript"> var v_state = "[@field:Divisions]" ; var o_state = document.getElementById("EditRecordDivisions") ; o_state.multiple = true ; function f_listbox3() { if ( v_state.indexOf(",") > 0 ) { for (var i=0 ; i < o_state.options.length; i++ ) { if(o_state.value == v_state) { o_state.remove(i); break ; } } var o_st = v_state.split(", ") ; for (var j=0 ; j < o_st.length; j++) { for (var i=0 ; i < o_state.options.length; i++ ) { if(o_st[j]== o_state.options.value){ o_state.options.selected = true ; break ; } } } } } window.onload = f_listbox3 ; </script> Thank you for your help!
  7. Hi I notice whenever I use javascript within caspio datapage and do a preview, it seems to work. However when I save my datapage and have it deployed to my web environment, the script does not work at all. Anyone know why and how I can fix this? Thanks in advance.
  8. In an html block on a Details datapage, I'm trying to show buttons with hyperlinks to social media pages using font awesome icons. The issue, though, is I need to show/hide these font awesome icons based on whether the datafield used for the url is null/blank or not. Basically, if the user has not entered a url link in the 'Facebook' field then I need to hide the Facebook font-awesome/hyperlink (because there is no url for Facebook for that record). I just want to show the social media links that have actual urls and hide those that don't. Here's the code to a couple of those hyperlinks (Facebook and LinkedIn- there are actually 6 in total but I didn't want to clutter this question). <div style="font-size:20px"><a href="[@field:myFacebookfieldname]" target="_blank"><i aria-hidden="true" class="fa fa-facebook-official"></i></a>&nbsp;&nbsp;<a href="[@field:myLinkedInfieldname]" target="_blank"><i aria-hidden="true" class="fa fa-linkedin-square"></i></a></div> For example, if [@field:myFacebookfieldname]=null then I need to hide (display:none) that hyperlink so it- the font awesome icon- doesn't show. I'm not a js expert so I hope someone here could help get this to work. Many thanks in advance. I was trying something like the below, to put the 'section1' attribute into the hyperlink above but that's not correct... <script> var v_fbook = parseFloat(document.getElementById("EditRecordmyFacebookfieldname").value); if(!isNaN(v_fbook)) { document.getElementById('section1').style.display = "block"; } else { document.getElementById('section1').style.display = "none"; } </script>
  9. Hi Hope someone can help me out here with my javascript problem. I have a submission form (which is multi-step form, 2nd page of a form which is now a update form) which is collecting information like project type, project name, description. It is cascading from project type -> project name -> description Because I can't do a cascading text area for "description". I have created a virtual text field for this value hoping to copy this into the "description" text area. I am having no luck with javscript which I have modify from what i found on this forum. Can someone please help me? This is what I have came up with. <script type="text/javascript"> // Caspio form elements var description = document.getElementById('EditRecordDescription'); var temp_description = getElementsByName("cbParamVirtual1")[0].value; var caspioForm = document.getElementById('caspioform'); // Event handler var Copy = function () { // TODO: assign value to description field description.innerHTML = temp_description; } document.getElementById("caspioform").onload= Copy; </script>
  10. Hello, I have a search and report datapage where I have added an HTML block in the results section which has an iFrame element inside of it. I am trying to accomplish this: User processes a search, results are shown where some results will equal saved results from another table. So table (A) produces results that I want to cross-check to table (B). If there is a match based on an ID field in both tables (A+B), I want the iFrame element to show basic data (timestamp & user name). I was successful in doing this part... Here is where I am having problems.... If table (B) does NOT match (right now shows "No record found."), I want the iFrame to show another datapage which is a form submit (this is the form that copies the data from table (A) to table (B). I am actually able to get both of these parts working, but I cant get them to work together. So I can either get the results page to show a button that says "save" and then it saves that data from table (A) to table (B). But then it won't show the timestamp and user name after a page refresh. Or I can get the results page to show timestamps and user names even after a page refresh, but then I can't get the "Save" button/option to show. I need some sort of Javascript if/then option. Thank you for ANY help with this!!!
  11. I use the below code in my caspio datapage under emails & destination as suggested by in the forum. It was working like a charm but suddenly now it does not work anymore. anyone can help with new code or why it is not working? <script> window.close(); window.onunload = function(){ window.opener.location.reload();} </script>
  12. Hi All, I'm new to the forum and Caspio. So I'm still on a journey of discovery and therein I have encountered a challenge. I'm looking for help in developing a javascript that returns an html symbol in the results page depending on the time that has lapsed from Date1. The idea is that the html symbol keeps changing color based on how much time has lapsed. The field only resets when there's status update. Below I have html symbol I was hoping would fullfil this objective... <h1><span style="color: #99cc00;">✪</span></h1> <h1><span style="color: #ff9900;">✪</span></h1> <h1><span style="color: #ff0000;">✪</span></h1> I'm not java savvy hence my approaching the forum....perhaps there's someone who can d this with their eyes closed. I have a clear objective in my mind of what I'd like to see happening but don't have all the requisite skills. Please see attachment for better idea of objective I look forward to hearing from you. Maynard (RSA)
  13. <script type="text/javascript"> document.onkeydown = function () { sysend.broadcast(); }; var audio1 = document.getElementById("player"); window.addEventListener("keydown", playPauseKb, false); alert(audio1.id); //document.getElementById("audio1").onkeypress = function () { document.getElementById("audio1.id").onkeydown = function playPauseKb(event) { var x = event.keyCode; console.log(x); if (x == 113) { audio.currentTime -= 5;//F9 Rewined } else if (x == 114) { //event.data.$.preventDefault(); audio.currentTime += 5;//F11 forword } else if (x == 115) { if (audio.paused) { audio.play();//F10 paly/pause } else { audio.pause() } } sysend.broadcast(); }; </script> here I am getting id as alert but instead of displaying the id as alert I need to pass the id to multiple tabs and these multiple tabs are opened by the user dynamically to this dynamically opened mutiple tabs I need to pass the id in such a way that my extension works with keydown And when I am in that tab where I have audio this is my code <asp:TemplateField HeaderText="Play Audio File" ItemStyle-Width="200px" ItemStyle-HorizontalAlign="Center" > <ItemTemplate> <audio controls="controls" id="player"> <source src='<%# Eval("audio") %>' /> your browser does not support the audio element.</audio> </ItemTemplate> </asp:TemplateField> <script type = "text/javascript"> var audio = document.getElementById("player"); window.addEventListener("keydown", playPauseKb, false); function playPauseKb(event) { var x = event.keyCode; console.log(x); if (x == 120) { audio.currentTime -= 5;//F9 Rewined } else if (x == 122) { //event.data.$.preventDefault(); audio.currentTime += 5;//F11 forword } else if (x == 121) { if (audio.paused) { audio.play();//F10 paly/pause } else { audio.pause() } } } </script> which works with keydown but if user opens a new tab dynamically keydown is not working how can I control the audio with keydown from multiple tabs
  14. I am using Laravel as backend and bootstrap as frontend I am using transaction ID from orders in table. Now if user clicks on that transaction ID, then I want to display the order on Bootstrap Modal... Here is code of Frontend : <table id="example" class="table table-striped table-bordered " cellspacing="0" width="100%"> <thead> <tr class="bg-info"> <th><center>Transaction ID </center></th> <th><center>Shop Name </center></th> <th><center>Sales Man </center></th> <th><center>Processed ? </center></th> </tr> </thead> <tbody align="center"> @foreach ($ordersList as $order) <tr id = "tr_{{$order->id}}"> <a> <td id="{{ $order->transaction_Id }}" data-toggle="modal" data-target="#modal{{$order->transaction_Id}}" style="cursor:pointer;color:blue" onclick="getCollapseData(id)"><u> {{ $order->transaction_Id }} </u></td> <td>{{ $order->Shop }}</td> <td>{{ $order->Sales }}</td> <td> <input id="chk_{{ $order->id }}" type="checkbox" name="is_Processed" onclick="orderProceesed(id)"><br> </td> </a> </tr> <!-- Modal --> <div class="modal fade" id="modal{{$order->transaction_Id}}" role="dialog"> <div class="modal-dialog"> <!-- Modal content--> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title">Modal Header</h4> </div> </div> </div> </div> @endforeach </tbody> </table> here is code of JavaScript Function : function getCollapseData(data) { //alert(data); $.ajax({ method : "GET", url: "orders.getCollapseData", data: {id: data}, success : function(response) { //alert(response); //$("#collapse"+data).empty(); //debugger; document.getElementById("modal"+data).innerHTML = ""; var receivedData = response; var html = ''; //alert("modal"+data); html += '<div class="modal fade" id="modal'+ data +'" role="dialog">'; html += '<div class="modal-dialog">'; //<!-- Modal content--> html += '<div class="modal-content">'; html += '<div class="modal-header">'; html += '<button type="button" class="close" data-dismiss="modal">&times;</button>'; html += '<h4 class="modal-title">'+ data +'</h4></div>'; html += '<div class="modal-body">'; html += '<table class="table table-striped table-bordered " cellspacing="0" width="100%">'; html += '<thead>'; html += '<tr class="bg-info">'; html += '<th><center> Product Name </center></th>'; html += '<th><center> Quantity </center></th>'; html += '</tr></thead>'; html += '<tbody align="center"><tr>'; for(i=0;i<response.length;i++) { html += '<td>' + receivedData.Product + '</td>'; html += '<td>' + receivedData.qty + '</td>'; } html += '</tr></tbody></table></div>'; html += '</div></div></div>'; document.getElementById("modal"+data).innerHTML = html; } }); } I am missing something and modal is not getting displayed
  15. I am trying to format multiple fields on a page. The first is the phone number, which I found the JavaScript for on the JavaScript forum. My issue is that I need to format phone number, social, and a tax-ID on one page and I am unsure how to accomplish this task. For phone number I am using the script below, plus I found another for formatting a social on StackExchange, but my JavaScript reading/writing skills are sub-par and I did not combine these correctly. Then I want to add in the option to format the tax ID as well, which is ##-####### (2 digits, dash, 7 digits). <SCRIPT LANGUAGE="JavaScript">function f_a(v_id){return document.getElementById(v_id);}f_a('EditRecordPhone_Number').maxLength = 14;f_a('EditRecordPhone_Number').onkeyup = function(v_e){v_e = v_e || window.event;if (v_e.keyCode >= 65 && v_e.keyCode <= 90){this.value = this.value.substr(0, this.value.length - 1);return false;}else if (v_e.keyCode >= 37 && v_e.keyCode <= 40){return true;}var v_value =(this.value.replace(/[^\d]/g, ''));if (v_value.length==7) {this.value = (v_value.substring(0,3) + "-" + v_value.substring(3,7));}else if(v_value.length==10){this.value = ("(" + v_value.substring(0,3) + ") " + v_value.substring(3,6) + "-" + v_value.substring(6,10));};}function(){document.getElementById("SSN").onkeyup = function() {var val = this.value.replace(/\D/g, '');var newVal = '';if(val.length > 4) {this.value = val;}if((val.length > 3) && (val.length < 6)) {newVal += val.substr(0, 3) + '-';val = val.substr(3);}if (val.length > 5) {newVal += val.substr(0, 3) + '-';newVal += val.substr(3, 2) + '-';val = val.substr(5);}newVal += val;this.value = newVal;};</SCRIPT>
  16. Can someone help with this javascript please...I'm using a submission form and one of the fields in the calculation is a cascading dropdown with a parent of Merchandise_ID and the other is a text input field. Not sure why its not working, but nothing is showing up in the destination field. <strong><span style="color:#000000;"></span></strong> <strong><span style="color:#000000;"> <div id="mypage1"> </div> <SCRIPT LANGUAGE="JavaScript"> function calculate() { var Gross_Qty_Sold = isNaN((parseFloat(document.getElementById("InsertRecordGross_Qty_Sold").value)))?0:(parseFloat(document.getElementById("InsertRecordGross_Qty_Sold").value)); var Merchandise_Cost = isNaN((parseFloat(document.getElementsByName("InsertRecordMerchandise_ID_Merchandise_Cost")[0].value)))?0:(parseFloat(document.getElementsByName("InsertRecordMerchandise_ID_Merchandise_Cost")[0].value)); var total= (Gross_Qty_Sold * Merchandise_Cost); document.getElementById("mypage1").innerHTML=' $'+total ; document.getElementById("InsertRecordGross_COGS").value=total.toFixed(2) ; } document.getElementById("InsertRecordGross_Qty_Sold").onchange=calculate; document.getElementsByName("InsertRecordMerchandise_ID_Merchandise_Cost")[0].onchange=calculate; calculate(); </SCRIPT> </span></strong>
  17. Hi, With the responsive gallery code ( on mobile), the results are confined to being separated by <tr>'s (or in some cases colspan="2") meaning that a field label can't be followed by it's value on the same line. I'm wondering if I hide the field label can I append the field label to the value using javascript? For instance: (as it exists) Booth # 34 For instance: (as I'm trying to do) Booth # 34 <---- ("Booth #" label hidden in datapage but appended to beginning of value through code) Never mind! I figured it out No JS needed!
  18. I have a datapage submission form which I need to make a counter based on an external parameter. Virtual2 receives an external parameter (authorization field) on loading. This works fine. Goods is a hidden field in the datapage. An updated value should be saved in this field on submission. The script goes like below, but it doesn’t work. Actually I cant get goods to receive and store any value. Please advise on solutions. <SCRIPT LANGUAGE="JavaScript"> Function calculate() { var number = parsefloat(document.getElementsByName('cbParamVirtual2')[0].value); var newnumber = number + 1; document.getElementById('InsertRecordgoods').value = newnumber; } document.getElementById("caspioform").onsubmit= calculate; </SCRIPT>
  19. We have a number of processes which were originally built to update single records and used javascript to test for certain conditions and post values into fields dependiong upon the results. As an example, if an agent clicks the JS button to mark a job as compete, the script caclulates the current time plus 10 minutes and posts that to a field. When looking at the "live" situation on screen, the controller screen filters for jobs that are either no marked as complete, or where the Completed Time + 10 mins field value is after no (i.e. a job will be shown if completed within the last 9 minutes). This process works fine when an agent is only dealing with a single job but if he is processing a bulk edit of multiple jobs, the script fails to operate. Is it possible to run javascripts within the bulk edit popup window and if so, is there some code we need to enter to ensure that each record selected for bulk edit receives the same correct data? Any helkp woud be appreciated - even if it just tells me that it cannot be done so I can stop wasting my time trying. Thanks
  20. <script type="text/javascript"> function calculate(){ var pm1 = document.getElementById("cbParamVirtual3").value; var pm2 = document.getElementById("cbParamVirtual8").value; var pm3 = document.getElementById("cbParamVirtual13").value; var pm4 = document.getElementById("cbParamVirtual18").value; var pm5 = document.getElementById("cbParamVirtual23").value; var pm6 = document.getElementById("cbParamVirtual28").value; document.getElementById("EditRecordTotal").value = pm1 + pm2 + pm3 + pm4 + pm5 + pm6; } document.getElementById("Mod0EditRecord").onmouseover=calculate(); </script> There's my code, I don't know why it's not executing. I tried using the Inspect option in my browser and found this... being called on this line var pm1 = document.getElementById("cbParamVirtual3").value; The field is not null, so I inspected the field I inspected that field and the inspector tells me the Id of that field is actually as follows: So it seems a random set of characters is being added at the end of all my fields, making me unable to "getElementById" since I'll never know what the random set is going to be... How can I either find out that random set or stop it from being generated? Thanks!
  21. Hello, I tried to apply the examples from other post but not sure if applies, so I will try if somebody can help me to address the problem. have a table of where one of the field is a "number". I can insert a new line on the top of the table, but I want that the value of the "number" field of the new line is automatically filled with the MAX+1 value of all the others number in the result table. I already have the aggregate with MAX+1 and I would like to pass this value in the hidden "number" field. Thanks for the help Bye, Sergio
  22. Hi everyone, I've found this followig javascript code that allows me to move listbox items to one another listbox. The code works as he is on a submission form. But now I would like te reference my database listbox instead of the exemple. Can someone help me? Thanks The name of my "from" listbox is ID_SEARCH_FORM and the "to" listbox is cbParamVirtual1. CSS: <style type="text/css"> select { width: 200px; float: left; } .controls { width: 40px; float: left; margin: 10px; } .controls a { background-color: #222222; border-radius: 4px; border: 2px solid #000; color: #ffffff; padding: 2px; font-size: 14px; text-decoration: none; display: inline-block; text-align: center; margin: 5px; width: 20px; } </style> JAVASCRIPT: <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"> </script> <script> function moveAll(from, to) { $('#'+from+' option').remove().appendTo('#'+to); } function moveSelected(from, to) { $('#'+from+' option:selected').remove().appendTo('#'+to); } function selectAll() { $("select option").attr("selected","selected"); } </script> HTML: <form name="selection" method="post" onSubmit="return selectAll()"> <select multiple size="10" id="from"> <option value="html">Html</option> <option value="css">Css</option> <option value="google">Google</option> <option value="javascript">Javascript</option> <option value="jquery">Jquery</option> <option value="regex">Regex</option> <option value="php">Php</option> <option value="mysql">Mysql</option> <option value="xml">Xml</option> <option value="json">Json</option> </select> <div class="controls"> <a href="javascript:moveAll('from', 'to')">&gt;&gt;</a> <a href="javascript:moveSelected('from', 'to')">&gt;</a> <a href="javascript:moveSelected('to', 'from')">&lt;</a> <a href="javascript:moveAll('to', 'from')" href="#">&lt;&lt;</a> </div> <select multiple id="to" size="10" name="topics[]"></select> <form>
  23. Hello, In a result list of Action Items (todo) I want the user to just check a box and the items on the line of the checkbox changes its status to "In Approval". I used this code in an HTML block (repeated every line), but doesn't seem to work. <input id="doneCheck" type="checkbox" onclick="done();"> <script> function done() { if (document.getElementById('doneCheck').checked) { document.getElementById("InsertRecordStatus").value="In Approval"; } } </script> Any advise? Thanks Sergio
  24. I have the Javascript in our submission form to format the phone numbers to this format: (123) 456-7890, but sometime I need to add an extension to that. Is there a way to edit the Javascript so that I have the option to have it look like this: (123) 456-7890 x123. I don't want to have a separate column in the table to add an extension because they aren't always there and it will show up funny in the results tables. Any thoughts?
  25. Hi i'm a newbie to scripting of any sorts and i have a problem i'm trying to replace a text field on a submission form based on the contents of another field (dropdown), with the contents of either of two other text fields. In essence if the contents of one field "Name_Type" equal "Muscle Group" then I want the field "Workout_Name" to equal the contents of the Muscle_Group_id field, likewise if the contents of field "Name_Type" equal "Workout_Type" then I want the field "Workout_Name" to equal the contents of the Workout_Type_id field. If neither is the case then I want the contents of the field "Workout_Name" to stay as it is. If had an attempt at scripting this which I placed in the footer of the submission datapage but without success, can anyone help? <SCRIPT LANGUAGE="JavaScript"> function replace () var name_type = document.getElementById("InsertRecordName_Type").value; var muscleG = document.getElementById("InsertRecordMuscle_Group_id").value; var workType = document.getElementById("InsertRecordWorkout_Type_id").value; var work_name = document.getElementById("InsertRecordWorkout_Name").value; if (name_type = "Muscle Group") { var Work_nameSubmit = muscleG; } else if (name_type = "Workout Type") { var Work_nameSubmit = workType; } else { var Work_nameSubmit = work_name; } document.getElementById("caspioform").onsubmit=replace; </SCRIPT>
×
×
  • Create New...