[Solved] Convert Javascript code to PHP code [closed]

Replace: longitude.indexOf(“E”) >= 0 With: strpos($longitude, ‘E’) !== FALSE And: longitude = longitude.substring(1); With: $longitude = substr($longitude, 1); Just change the variables for other occurrences. This uses strpos() and substr() 1 solved Convert Javascript code to PHP code [closed]

[Solved] Regex number between [closed]

You can use a regex range generator, such as http://gamon.webfactional.com/regexnumericrangegenerator/ I think this regular expression will do it: /^-?([0-9]|[1-8][0-9]|9[0-9]|100)$/ 1 solved Regex number between [closed]

[Solved] enabling of textbox when a value in a drop down box selected [closed]

Below is sample code for enable textbox on selectbox option select. Please do required changes. <script type=”text/javascript”> function showtextbox() { var x=document.getElementById(“intext”). x.disabled=false; } </script> </head> <body> <form> <select onChange=”showtextbox()””> <option >one</option> <option>two</option> </select> <input type=”text” id=”intext” name=”intext” disabled=’disabled’> </form> </body> </html> Use your php code to connect and insert data in database. 2 solved … Read more

[Solved] Explain what the function does [closed]

It hooks the submit event on all forms that exist as of when that code runs and, when the event occurs, prevents the default action (submitting the form) and instead dumps out the form contents to the web console. Details: // v— 1 vvv–2 v—- 3 $( “form” ).on(“submit”, function( event ) { // ^^^^^^–4 … Read more

[Solved] IF ELSE in Java Script

Try the following: if (Group == ‘Customer’) { if(Status != ‘Agreement’) { cell.css (‘color’, ‘blue’); } } else if (Group == ‘Non-customer’) { if (Staus == null) { cell.css (‘color’, ‘green’); } else if (Status != ‘Agreement’) { cell.css (‘color’, ‘yellow’); } else if (Status != ‘Not declared’) { cell.css (‘color’, ‘purple’); } } solved … Read more

[Solved] I was wondering if a JavaScript programmer could help me write a javascript function to extract the x-y points from a JSON string [closed]

You need to use JSON.parse(); it transforms your string into an array. var jsonStr=”[{“y”: 0.0, “x”: 0.0}, {“y”: 5.0, “x”: 5.0}]”; var array=JSON.parse(jsonStr); console.log(array[0].x,array[1].x); array contains everything you need. array[0] is the first set of values. array[0].x is the first x value. DEMO http://jsfiddle.net/uXr5g/1/ 1 solved I was wondering if a JavaScript programmer could help … Read more

[Solved] Get all child nodes javascript

If you want all children of tdiv to be added to el then try var el = document.getElementById(‘x’) while (tdiv.firstChild) { el.appendChild(tdiv.firstChild); } Demo: Fiddle 4 solved Get all child nodes javascript

[Solved] Using jQuery to validate checkboxes and input text values

This might get you started. You can make the field validation as complex or simple as you wish. $(‘input[type=checkbox]’).click(function(){ var tmp = $(this).next(‘input’).val(); //validate tmp, for example: if (tmp.length > 1){ //alert(‘Text field has a value’); $(‘#mybutt’).prop(‘disabled’,false); }else{ //alert(‘Please provide a long value in text field’); $(‘#mybutt’).prop(‘disabled’, true); $(this).prop(‘checked’,false); } }); <script src=”https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js”></script> <input id=”mybutt” … Read more

[Solved] I am trying to make a function that determines the browser but the new Microsoft Edge is not being detected

It looks like the full user agent string for desktop is: Mozilla/5.0 (Windows NT 10.0; <64-bit tags>) AppleWebKit/<WebKit Rev> (KHTML, like Gecko) Chrome/<Chrome Rev> Safari/<WebKit Rev> Edge/<EdgeHTML Rev>.<Windows Build> This is according to Microsoft’s documentation: https://msdn.microsoft.com/en-us/library/hh869301(v=vs.85).aspx So, I suppose you just have to search for the substring ‘Edge/’, and you’ll have your answer. I didn’t … Read more