JavaScript

120K

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

I am trying to validate 3 forms within bootstrap modal

If I am validation 1 form everything is fine when I add the validation for second for I am getting an error message

jquery.min.js:2 Uncaught RangeError: Maximum call stack size exceeded
    at String.replace (<anonymous>)
    at fa (jquery.min.js:2)
    at Function.fa.matches (jquery.min.js:2)
    at Function.n.filter (jquery.min.js:2)
    at z (jquery.min.js:2)
    at n.fn.init.is (jquery.min.js:2)
    at b._getMessageContainer (bootstrapValidator.min.js:11)
    at b._getMessageContainer (bootstrapValidator.min.js:11)
    at b._getMessageContainer (bootstrapValidator.min.js:11)
    at b._getMessageContainer (bootstrapValidator.min.js:11)


Open in new window


<div id="myModal" class="modal fade" role="dialog">
			<div class="modal-dialog" role="document">
			    <!-- Modal content-->
			    <div class="modal-content">
			    	<div class="modal-header">
			        	<button type="button" class="close" data-dismiss="modal">&times;</button>
						<h2 class="modal-title">Account Login</h2>
			    	</div>
				<div id="div-forms">
					<form data-toggle="validator" role="form" id="login-form"  method="POST">
					<div class="modal-body">

			        	<h3>Welcome to I Drive Smart. Please log-in to access your account.</h3>
			        	<div class="alert alert-danger" role="alert" style="display: none;">
  							Your user name OR password does not match our record. Please re-enter user name and password.
						</div>

	

Open in new window

0
Salesforce Made Easy to Use
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

What is the client side version of populating a textbox with 6 random numbers when clicking a button?
0
We have  hosted  a UI application using Node js on AWS Elastic beanstalk in production environment . Because of minimal 1 to 5 % 5XX errors the EC2 instances keep going into degrade and then warning state. This is happening for very few minutes time interval. After sometime EC2 instance goes into normal state.  How to configure the threshold for 5 xx error so that we cannot see the server into degrade or warning state.
Server_State.PNG
0
Hi,

I have this code to append td to my table and this is working fine

var $tr = $('<tr>').append(
															
	$('<td>').html(resultStateList.list_state_name),
	$('<td>').html(resultStateList.list_state_active),

).appendTo('#countries-list tbody');

Open in new window


What I need to do is to display different span in the active <td> depending if list_state_active is Y or N.

Something like this but I cannot make it work with the append code...

      
if ( resultStateList.list_state_active === 'Y'){
	   $('<td>').html('<span class="badge bg-green">' + '<?php echo ASLang::get('yes'); ?>' + '</span>' )
	} else if (resultStateList.list_state_active  === 'N') {
	  $('<td>').html('<span class="badge bg-red">' + '<?php echo ASLang::get('no'); ?>' + '</span>' )
	} else  {
	$('<td>').html(resultStateList.list_state_active),
       }

Open in new window


Thanks
0
Hi,
I have some problem to Bar chart. What to correct below to last line below?
16p.png
0
What are some good websites to help keep me current with the latest and greatest for C#.NET Full Stack development?
0
I am starting a bit of a re-training session to get back into the work force after a few weeks out. The problem is my last job did a lot of legacy debugging on MVC and ASP.NET web pages, SQL Query db work SSRS updates.

Nothing too exciting and nothing too strength building for my next job.

I have done C#.NET Full Stack in various jobs before that but not made the jump to Angular, let alone Angular 2.

What are some good technologies today I should consider learning and what technologies are good to brush up on?

How about C#.Core? I do  not see too many EE mebers in that group...

What JS frameworks are the best to know?

I can devote lots of time to study, and would consider digging deep.

Thanks
0
I have an html5 web page created using a javascript countdown counter. I'd like to open a new web page or navigate to a new web page in the existing IFrame.
0
Space_Edit.phpI have a php program that calls another php using java and returns the results.
If I run it on my machine the code works.  I fired up an old box running win 7 and it works there as well.  When I run it on my son's machine the screen turns "white" and I get a message that the script timed out.  This happens on my partner's machine as well.  
The php works on my partner's phone as well as his brother's laptop!

What could be going on?  Could this be a problem with browser plug-ins?

I've attached the code in question.
persons.php
0
Is it possible, to create an Event Listener, in Java Script,  with an object from an Xpath? Currently I was only able to find information about element ID.
0
Independent Software Vendors: We Want Your Opinion
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Greetings again,

I have this RadioButtonList control with a Yes or option in Repeater control.

                 Purchased:<asp:radiobuttonlist ID="rblType" runat="server" RepeatDirection="Horizontal" TextAlign="Right" style="display:inline;">
                 <asp:ListItem Text="New" />
                 <asp:ListItem Text="Used" />
                </asp:RadioButtonList>

Open in new window


All I am trying to do is to ensure that user chooses either Yes or No before continuing.

I have done a lot RadioButtonList validations but have not found anything that works with Repeater control.

Any ideas experts?
0
Hi all,

Hoping you can help me.  I would like to show a toolset on hover when hovering over any element with a certain class.
Do i need to embed the code every time, in each element, or can I just show it on hover. So perhaps have the toolset as a javascript snippet.

For e.g. the toolset could be:
<div>
  <ul>
    <li><a href="#">DRAG</a></li>
    <li><a href="#">DELETE</a></li>
  </ul>
</div

Open in new window

Of course it would be formatted with CSS.

And it would appear on top of any <div> element with the class 'tools'
<div class="tools">
  content
</div>

Open in new window


On hover of this div, the toolset would appear on top. There would be a range of div's with the same class on the page.
So the tools would allow editing of that div - in this above instance I could drag it around or delete the div area with jQuery.

Thanks
Paul
0
I have a VBScript that I don't understand very well and I need to edit it to append another field to it's result.
The final result of varToEmails needs to include the value of field TeamAlerts. I don't know where to insert it into the code.

function getVarToEmails()
{
   var itm = "";
   for(var i = 0; i < document.form.varTo.options.length; i++)
   
   {
      if (document.form.varTo.options[i].selected)
         itm += "; " + document.form.varTo.options[i].text; // or .text, depending
   } 
   if (itm != "")
      itm = itm.substr(1);
	  	document.form.varToEmails.value = itm
   return itm;
}

Open in new window

0
Hi all,
I have a small bit of jquery code that when clicked adds a text field, how can I have the field thats been added removed when a user clicks on the X?

You can see what I have so far at:

http://www.dnx.org/tope/1.html
0
I want to modify the default behavior for link click: before actually following the link, I want to wait 3 seconds. Here's my code:

<div id="appdtic">appdtic</div>
<div><a href="tst.html?from=link1">first link</a></div>
<div><a href="tst.html?from=link1">second link</a></div>
<div><a href="tst.html?from=link3">third link</a></div>
<script>
   function dofunc(loc) {
      window.location.href=loc;
   }
   var elements = document.getElementsByTagName('a');
   for(var i = 0, len = elements.length; i < len; i++) {
      elements[i].onclick = function () {
         document.getElementById('appdtic').style.backgroundColor='yellow';
         alert('some alert!');
         setTimeout(dofunc(elements[i].href), 3000);
         return false;
      }
   }
</script>

Open in new window


Problem is that it does not wait 3 seconds.
Alerts are for testing purposes.

Thank you for your time.
0
Hello,
How can I write a javascript to write a event on cell click of an table.

Regards
0
I wanted to change the background color of a DIV (id=appdtic) on every click on all links; the bg-color should stay yellow for 3 seconds, and then the browser should load the link provided. Here's the code that does NOT work:

<div id="appdtic">appdtic</div>
<div><a href="tst1.html">first link</a></div>
<div><a href="tst2.html">second link</a></div>
<div><a href="tst3.html">third link</a></div>
<div><a href="tst4.html">fourth link</a></div>
<script>
   function dofunc() {
      alert('func alert!');
   }
   var elements = document.getElementsByTagName('a');
   for(var i = 0, len = elements.length; i < len; i++) {
      elements[i].onclick = function () {
         document.getElementById('appdtic').style.backgroundColor='yellow';
         alert('some alert!');
         setTimeout(dofunc, 3000);
      }
   }
</script>

Open in new window


The alerts inside the functions are for testing purposes. But, this doesn't work as expected. For me, it seems that setTimeout is ignored. What is wrong in the code?

For comparison, here is another code that works, although id does something else (it waits 3 seconds before actually submitting the form):

Yes, the button is not of a submit type, and is outside the form, so to circumvent the default event of the form.

<form name="formular" id="formular" method="post" action="test2.php">
</form>
<input type="button" value="send" id="submit">
<script>
    function submitForm() {
        document.getElementById("formular").submit()
    }

    document.getElementById('submit').onclick = function() {
        setTimeout(submitForm, 3000); 
    }
</script>

Open in new window


Thank you for your time.
0
Hi Experts,

Using JS how can i Reload tthe same page without Query String
0
A past IT person has enabled Windows Power Shell scripts (with .PS1 extensions) to run with full unrestricted access on an organization's Windows 10 computers.

None of these computers are added to a domain.

What is the best method to use to disable these Power Shell scripts so that they will no longer be able to run?

We don't want to take any chances with viruses or malware exploiting this security hole.
0
Creating Instructional Tutorials  
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

I have a web part page displaying 5 web parts. Four of the web parts (Efforts, Phases, Capture Points & Areas) are "provider" web parts, and come from lists that are the sources of 4 lookup columns in the 5th "consumer" web part (Lessons Learned).

The provider web parts are displaying the Title column from the lists.

The Using Javascript/jQuery, I "connected" the 4 provider web parts to the consumer web part, such that when you click on a Title column value, the consumer web part is filtered to show only those records that have the clicked value in the relevant metadata column.

All that is working very nicely.

Now, my requirement is to go one step further, and display the number of items that will be displayed if you click on a Title column value in any of the 4 web parts. If there are none, a "0" should be displayed.

I've constructed a lists service query that successfully returns the number of items that exist for a given, hard-coded, metadata value:
[SiteURL]/_vti_bin/listdata.svc/[ListName]/$count?&$filter=Effort/Title eq 'AAA'

So, the goal is to display such an item count beside the corresponding provider web part value, such as:
Efforts web part:
AAA (10) //assuming there are 10 items in the consumer web part tagged with Effort 'AAA'

Now, I'm bumping up against the current limit of my abilities.

I know that I need code (javascript, rest, ajax, json) for each provider web part with looping to cycle through all of the TD cells that have …
0
I need to put a share button on a page but the place I need to put it can only have html no javascript.

Is it possible to do a share link that works like : https://www.facebook.com/sharer/sharer.php?u=www.share.com

But does not require me to include the u= and it gets this information from the referring page?

Thanks,
0
On this page:
http://groupplanner.gallitin.com/flight/create?depart=07%2F20%2F2017&return=08%2F05%2F2017&tripID=22&tripName=ABC#

I have the button "Add Flight" and it clones the input you see there, the issue is that the name of the fields are:

com0[]airline[]
com0[]flightNumber[]
com0[]departing[]
com0[]seatNumber[]

Open in new window


When cloning I need the com0 to increase to com1, if cloned again then com2 etc...
0
Oh men,
Im wondering it is a free plugin or some calendar for  an consulting room apointment
its any idea or recomendation if its for free or open source better
regards
0
Hello,
I am using javascript on frevvo.
How can I find cell value when a row is clicked on a table.

Regards
0
I am using Javascript, HTML, Json and PHP.  The emails were sending but now they are not.  Any help is appreciated.  Thank you.

www.mediascrubber.com/videos.html


<script src="https://code.jquery.com/jquery-2.2.4.js"></script>
<script>
$(function() {
  $("#myform").on('submit', function(e) {
    e.preventDefault();
    $.ajax({
      url: '//jsbin.com/vufeyag.json',
      dataType: 'json',
      data: $("#myform").serialize()
    }).done(function(d) {
      if (d.success==true) {
        $("#myform").hide();
        $("#results").text("Thanks!").show();
      }
    });
  });
});
</script>>

Open in new window


<?php

$webmaster_email = "ds@mediascrubber.com";
$email_address = $_REQUEST['email_address'] ;

function isInjected($str) {
	$injections = array('(\n+)',
	'(\r+)',
	'(\t+)',
	'(%0A+)',
	'(%0D+)',
	'(%08+)',
	'(%09+)'
	);
	$inject = join('|', $injections);
	$inject = "/$inject/i";
	if(preg_match($inject,$str)) {
		return true;
	}
	else {
		return false;
	}
}


if (!isset($_REQUEST['email_address'])) {
header( "Location: $feedback_page" );
}
elseif ( isInjected($email_address) ) {
header( "Location: $error_page" );
}
else {
mail( "$webmaster_email", "Subscruber",
 
   "From: $email_address" );
   

}
$jsonurl = "http://api.wipmania.com/json";
$json = file_get_contents($jsonurl);
var_dump(json_decode($json));
?>

Open in new window


<form id="myform" class="form-horizontal" action="send_mail.php" method="post">
				<div class="input-group">
                <input type="text" name="email_address" class="def-input" placeholder="Your Email Here">
                <span class="input-group-btn">
                <button class="btn-form btn" input type="submit">Subscribe</button>
                </span>
                
				</div>
                </form>
                <div id="results" style="display: none;"></div>

Open in new window

0

JavaScript

120K

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.