JavaScriptSponsored by Flatiron School

121K

Solutions

41K

Contributors

JavaScript is a dynamic, object-based language commonly used for client-side scripting in web browsers. Recently, server side JavaScript frameworks have also emerged. JavaScript runs on nearly every operating system and  in almost every mainstream web browser.

Share tech news, updates, or what's on your mind.

Sign up to Post

Here is my html code where i creating dynamic textbox for insert using jsp
function getinput()
{
index ++;
var singleRecord = "";
singleRecord += " Employee_id : <input type='text' READONLY name='txt_Employee_id"+index+"'value='<%=request.getParameter("employee_id")%>'>";
singleRecord += " Project_name : <input type='text' name='txt_project_name"+index+"'>";
singleRecord += "Project/Task : <input type='text' name='txt_Header"+index+"'>";
singleRecord += "Department : <input type='text' name='txt_Department"+index+"'>";
singleRecord += "Description : <input type='text' name='txt_description"+index+"'>";
<!--singleRecord+="Date : <input type='date'  name='datainsertdate"+index+"'>"; --->
singleRecord += "<hr/>";
$("#inputs").append(singleRecord);
$("#count").val(index);
}

</script>

</head>

<body background="123-slideshow\blue_background.jpg">
<form action="EmployeeVendorValidation.jsp" method="post">

   
     <br><br><br><br>    
<input type="hidden" name="count" id="count"/>



<div id="inputs">
</div>
<button type="button" onclick="getinput()" class="button button5">Add</button>

&nbsp;
<button type="submit" class="button button2">Submit</button>

jsp:

 Class.forName("oracle.jdbc.driver.OracleDriver");
          Connection con=DriverManager.getConnection("jdbc:oracle:thin:@172.18.114.213:1821:godb","xe","ex");
       PreparedStatement ps = con.prepareStatement("insert into employee_task values(?,?,?,?,?,?)"); …
0
Free Tool: ZipGrep
LVL 12
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Product I would like to understand how it works buy looking at the content then creating it anew with a different language since it can no longer be purchased.I have a file for a small program called "SQL Grep" it was designed by a company called www.Gatherbirdsoftware.com the product and company seem to no longer be in business. Last I heard was around 2010-2011. The file I have might be helpful with the design of the product I want to make a similar tool in another language. Python & Java. I do not think it was written in either of those languages.

My questions are:
1. Is it legal to look at someone else's code "if I can even open it...?"
2. And determine how the flow of the code works with the developers language. I do this because I am learning to develop now.
3. The intention is to  build my own product to do the same thing with a newer different language?
4. The product is no longer sold and the site down with no response from the owners? I have sincerely tried.

Originally the products on the site were sold to benefit a childrens hospital. I am doing this for a charity as well. If of course I can do this in the way I hope.
Please advise. Product I would like to understand how it works buy looking at the content then creating it anew with a different language since it can no longer be purchased.
0
I am trying to implement a map/direction based application using Google maps V3 API. So far I have been able to display the map and show directions for two locations selected. the first one is my current location , the second one is the location of costumer (his/her information exist in my database). All the markers are being displayed in the output properly.

you'll see that in the form select box is automatically detect user's location, Also, i add a panel in which to display directions.

the Destination field show to us the code client (code client is the code of costumers , it's a number ) so when we select the code client from the destination field it take the Geoaddress of this costumer (the owner of this code client) and it desplay location to it in the map from our location.

PS0 :
sorry about my english language , i try to explain good for you even i don't speak good english language

PS1 : code client and Geosddress and longitude and latitude ... all information in my database

PS2 : the code client is the code of costumer

information about the code

First, i create new objects before the init function - DirectionsService and DirectionsRenderer. and i configure the directionsDisplay object. i did it inside init function. Also, i add autodetection of user's location to init function.

i use W3C Geolocation. If the geolocation succeds we use Geocoding to get the user's address. If this succeds we enter that location to the …
0
I am looping through the Json  and searching for elemnets which have part of id="polyiCircle" or "polyLine" to exclude them from loading on canvas. How must I use next  code snippet

canvas.loadFromJSON( element1, function() {    
                canvas.renderAll();
                 }) 

Open in new window

or what other changes must I make in code below  to get the result?
var fromJson;
function getJsonF(){ 
$.ajax({
  method:"POST",
  url: '/wp-content/themes/4/PgetJson.php',
  data:  {
    "getCanvas":1,
    "whichProject":whichProjectToSave,
    },
    datatype: "text",
    success: function(strdate){
   console.log("getJsonF; "+strdate);
  var jsonParse=JSON.parse(strdate);
   
    for (var i = 0; i < jsonParse.objects.length; i++) {
        var element1=jsonParse.objects[i];
        var justIDC =jsonParse.objects[i].id;
           if (justIDC.includes('polycircle')){// do nothing     
         }else{
              if (justIDC.includes('polyline')){// do nothing  }else{
                canvas.loadFromJSON( element1, function() {    
                canvas.renderAll();
                 }) 
              }            
         }
    }
     },
     error: function(error, txtStatus) {
      console.log(txtStatus);
      console.log('error');
    }
 });
}

Open in new window

0
My partner runs thunderbird v52.7.0 and he keeps getting an error: "A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete. Script: chrome://global/content/bindings/browser.xml:237"

He doesn't have chrome installed. How can I troubleshoot this? Thanks!
0
jQuery or CSS to animate a lightening bolt.

I have an SVG that I would like to animate.  I want to fill it from top to bottom, so it is like a lightening bolt.  I know there are ways to use javascript to fill it but I have NO IDEA where to start.

The following is the SVG I would like to fill from top to bottom.
<svg version="1.1" id="bolt_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
                                                                         viewBox="0 0 600 612" style="enable-background:new 0 0 600 612;" xml:space="preserve">
                                                                <style type="text/css">
                                                                    .bolt_st0{opacity:0;fill:#FFFFFF;}
                                                                    .bolt_st1{fill-rule:evenodd;clip-rule:evenodd;fill:#D42229;}
                                                                    .bolt_st2{fill:none;}
                                                                </style>
                                                                <rect x="154.4" y="41" class="bolt_st0" width="276" height="530"/>
                                                                <polygon class="bolt_st1" points="192,569.5 430.2,270.9 321.2,253.1 415.3,41.1 155.2,322.3 263.2,345.6 "/>
                                                                <rect x="154.4" y="41" class="bolt_st2" 

Open in new window

0
Hi

I'm using DataTables to display some tabular data
Within the data I have a code column which I need to filter by

I can Hide the filtered rows using jQuery I'm not certain this is the best approach as it relies on the whole table being visible

I've made a JS fiddle to illustrate what I'm doing

I've simulated the query form by creating some static JSON and hosting in a myjson bin
0
I'm trying to connect to a service outside our firewall but on our servers and I'm getting the following error:

error
Here is the code:

Code
Not sure how I get around this? This is all new to me?

Thanks!
0
hi,

Many web pages contain information that is not stored in the source code for the page, eg pricing info, so it's harder to scrape.

Where is this info stored when loaded to a PC browser, and how can i read it? some kind of cache or cookie? i'm a newbie on the web side.

example Airbnb: https://www.airbnb.co.uk/rooms/.. any room id... ?checkin=20-05-2018&checkout=22-05-2018&guests=2

Background: I'm trying another angle to resolve this other question: https://www.experts-exchange.com/questions/29094633/Web-scrape-macro-VBA.html

Thanks
0
Hello,

I am getting the Wordpress error

 "TypeError: $ is not a function. (In '$( "#the_cat" )', '$' is undefined)",

here is my code

<select id="the_cat" name="the_cat"  data-validation="required" >
                  <option value="" selected >Please Choose</option>
                  <option value="1"  disabled >1. Landscape Architecture Activities</option>
	  <option value="2"  > &nbsp; &nbsp; a. Non Social Event - (1HR: 1CE)</option>
	  <option value="3"  > &nbsp; &nbsp; b. Social Event - (1 CE per Event)</option>
	<option value="4"  >2. Relevant Educational Programs - (1HR: 1CE)</option>
	 </select>

<div id="the_hours_div" class="row" style="display:none;">
                  <div class="large-3 columns">Hours: </div> 
                  <div class="large-9 columns"><input type="text" name="the_hours" value=""  data-validation="required"   ></div>
                </div>


 <script>
  jQuery('#the_cat').change(function() {
		if( ($(this).val() == 4) || ($(this).val() == 5) || ($(this).val() == 6) || ($(this).val() == 7) || ($(this).val() == 16) )
		{
		 $('#the_hours_div').show();
		}   else   {
		 $('#the_hours_div').hide();
		 }

	 });
  </script>
        

Open in new window

0
Free Tool: Port Scanner
LVL 12
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Show a button on a page. When that button is clicked, it shows a popup (not in another window or tab, it should be in the same page). This popup again will have a button. If you click on that button, it will show another popup. It will continue this way, and a popup will continue to appear above earlier popup.
0
if we select anything in  search box it should display in select box. please tell me how to set this link with Jquery.
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>jQuery UI Autocomplete - Default functionality</title>
  <link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
  <!-- <link rel="stylesheet" href="https:/resources/demos/style.css"> -->
  <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
  <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
  <script>
  $( function() {
    var availableTags = [
      "ActionScript",
      "AppleScript",
      "Asp",
      "BASIC",
      "C",
      "C++",
      "Clojure",
      "COBOL",
      "ColdFusion",
      "Erlang",
      "Fortran",
      "Groovy",
      "Haskell",
      "Java",
      "JavaScript",
      "Lisp",
      "Perl",
      "PHP",
      "Python",
      "Ruby",
      "Scala",
      "Scheme"
    ];
    $( "#tags" ).autocomplete({
      source: availableTags
    });
  } );
  </script>
</head>
<body>
 
<div  style="float: left;">
  <label for="tags">Search box : </label>
  <input id="tags">
</div>

<div style="float: left;">
  <label for="tags">Select box: </label>
  <select >
    <option></option>
    <option>ActionScript</option>
  </select>
</div>
 
 
</body>
</html>

Open in new window

0
Hi guys. I'm trying to perform a post method action in my php and the site that I post to returns "This site require javascript to be enabled". Now the problem is that this is a backend php script that is sending this post method. The site is http://mlungisi.0fees.us

How can I solve this?
0
1. I bought this template http://www.tattek.sk/minotaur-dash2/#/app/dashboard
and I'm customizing it.

2. On the link above, click on the "hamburger" on top. You see how the side menu shrinks and the main content expands
works
3. In my site, the side menu shrinks but the main content doesn't expand

You can see it here:

Site: http://147.75.0.117:88

Login with admin@admin.com / Password321$

doesn't work
4. I checked the Chrome Developer's tool and I see the CSS tag being added

css
5. I also put debug step in the demo site (I have the code locally from Themefoest).. There's a function setSmallNavigation() but  I commented it out and the demo still worked.

I'm not sure what I'm missing.
0
In full desktop size viewing this page https://www.rakaiaisland.co.nz/gallery/ why does the gallery fade to white as I scroll down the page? Note this seems to occur in Chrome but not Firefox.

How can I track down where the fade out is configured or styled so that I can stop it happening?

Thanks!
0
Hi E's,
I have a date mask, but not work perfect.
The code is this one:
<input id="lancamento" value="<? echo $linha[data2]; ?>" type="text" name="date" placeholder="yyyy-mm-dd" onkeyup="var v = this.value; if (v.match(/^\d{4}$/) !== null){this.value = v + '-';} else if (v.match(/^\d{4}\/\d{2}$/) !== null) {this.value = v + '-';}" maxlength="10">

Open in new window

The mask as been create for format data: yyyy-mm-dd.
The problem is, the last "-" not appear, and when I write the date occurs something like this: 2018-0422, when the correct is 2018-04-22!

What is wrong in my code?

The best regards, JC
0
I have a text field and want to implement regular expression to validate mm/dd format. I have a regex currently which works for this format but not able to validate against months like 29th February, 30th April etc.. How to modify the regex to include this month validation?

Currently regex I'm using is - (0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])
0
How to set a div scroll to top (after) page load using both java and vb code behind?
0
I have this snipped of jquery/js and Im trying to count how many times the search string is replaced, but number seems to stay at 0.

Any ideas?

    var number=0;
    var text = sentences.innerHTML;
    var regex = new RegExp('('+$(this).text()+')', 'ig',function() {
    return ++number;
});

    text = text.replace(regex, '<span class="highlight" style="background:'+rand+';">$1</span>');
    sentences.innerHTML = text;
  alert(number);

Open in new window

0
Upgrade your Question Security!
LVL 12
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

We have a editor-enabled DataTable which allows users to change a quantity field. When they do this we need the total cost to change on that row. Additionally a Grand Total needs to be updated. Is this possible without us resorting to Knockout?

The site is here:

http://localhost:64444/SampleOrder?OrderId=4
0
How to trigger keyboard keys in HTML?  I am currently using javascript and html.   I want to execute a tab and  enter.

Any ideas?
Thank you
0
Hi, When I have tried to hide the Inspect Icon by using the attribute from icon: ‘metadata_global’ to icon: ‘none’. It’s getting hide from the Inspect tab. But still hand cursor symbol is showing when we move the mouse on that field and its getting click when I click on that. This is my below code:

Content.Inspect.MetadataInspector.extend()
	.named("Content.Inspect.GlobalMetadataInspector")
	.reopen({
		name: "GlobalMetadata",
		isValid: function () {
			var model = this.get('model');
			return Core.model.ManagedObject.detectInstance(model);
		}.property('model'),
		modelChanged: function () {
			var contextId = this.get('model.finalManagedObject.canonicalId');
			if (contextId) {
				this.set('currentContext', contextId);
			} else {
				this.set('currentContext', null);
			}
		}.on('init').observes('model.finalManagedObject.canonicalId'),
		managedObjectBinding: 'model.finalManagedObject',
		icon: 'none',
		bodyView: Content.Inspect.MetadataView,
		titleBinding: 'Core.messageTable.content/inspect/manage/metadata/universal/title',
		labelBinding: 'Core.messageTable.content/inspect/manage/metadata/universal/title'
	});

Open in new window


Need to remove the icon and their corresponding items from the Inspect tab. Is there way to trace it. Thanks
0
Hi Experts,
I have 4 dropdown menus in my form. I would like to validate it so that the user must select at least one dropdown in order to submit the form.
If none of the dropdown menus are selected, a message should appear with the text "Please select at least one item".
Unfortunately the code below is not working in Internet Explorer, and the message is displayed next to each dropdown. I would like the message be displayed only once under the submit button. Is it possible to achieve this with JavaScript or jQuery? I would appreciate your help.
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.16.0/jquery.validate.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.16.0/additional-methods.min.js"></script>

<script>
  $().ready(function() {
  
    $("#mydropdowns").validate({
      rules: {
      Affiliation: {
        require_from_group: [1, ".select-group"]
      },
      DeviceName: {
        require_from_group: [1, ".select-group"]
      },
      AliasName: {
        require_from_group: [1, ".select-group"]
      },
      DeviceAccountID: {
        require_from_group: [1, ".select-group"]
      }
      },

    });

  });
  </script>

</head>
<body>
<div id="Affiliation" class="select-group"><div>

<form id="mydropdowns" method="POST" action="../Search/SearchResults.asp">
  <select name="Affiliation" 

Open in new window

0
Got an issue with this .js script.
This file gets loaded with every page since it is effectively a library of commands and previous variables.
The issue is that on a fresh browser load, the "CurrentState" variable does not get defined. If I tell the page to reload, everything works just fine.
What I'm trying to accomplish is on the initial load of the page, "CurrentState" is initialized to default values. One all other loads of the page, the previous values are retained.
if (window.performance) { // Check to see if browser supports this
    reload = performance.navigation.type;   // returns "1" if page is reloaded
} else {
    reload = 0;
}
 
// Check and see if a previous state of "CurrentState" has been saved.
if ((reload != 1) && ((myJSON = sessionStorage.getItem("CurrentState")) !== "null")) {
    CurrentState = JSON.parse(myJSON);
} else {
    CurrentState = {};
 
    (function(CurrentState) {
        CurrentState.Loaded = 0x0000;
        CurrentState.Board = 0;
        CurrentState.Analog = 0;
        CurrentState.RPM = 0;
        CurrentState.Rate = 500;t
        CurrentState.Units = 0;
        CurrentState.CANAutoStart = 0;
        CurrentState.CANBaud = 1000;
        CurrentState.CANTermination = 0;
 
        CurrentState.TCType = new Array(24);
        for (i = 0; i < 24; i++) CurrentState.TCType[i] = -1; // Undefined
 
        CurrentState.RPMType = new Array(8);
        for (i = 0; i < 8; i++) CurrentState.RPMType[i] = -1; // Undefined
 
        

Open in new window

0
How can I make sure that a user only enters a positive integer value of 1, 2, or 3 and keep prompting for another input if they enter a word, symbol, or negative number?  Attached is my current code.  Right now, my results are:

1. Monitor an Animal
2. Monitor a Habitat
3. Quit
Please choose an option:  apple
Please enter a valid option: horse
Please enter a valid option: 12422
Please enter a valid option: &
Exception in thread "main" java.util.InputMismatchException
      at java.util.Scanner.throwFor(Scanner.java:864)
      at java.util.Scanner.next(Scanner.java:1485)
      at java.util.Scanner.nextInt(Scanner.java:2117)
      at java.util.Scanner.nextInt(Scanner.java:2076)
attempt.txt
0

JavaScriptSponsored by Flatiron School

121K

Solutions

41K

Contributors

JavaScript is a dynamic, object-based language commonly used for client-side scripting in web browsers. Recently, server side JavaScript frameworks have also emerged. JavaScript runs on nearly every operating system and  in almost every mainstream web browser.