jQuery

17K

Solutions

5K

Contributors

jQuery (Core) is a cross-browser JavaScript library that provides abstractions for common client-side tasks such as Document Object Model (DOM) traversal, DOM manipulation, event handling, animation and Ajax. jQuery also provides a platform to create plugins that extend jQuery's capabilities beyond those already provided by the library.

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

Sign up to Post

Ok my problem,

I used ajax with case statements on php end.

function saveAct(){
    
    
    
    
    var testAct = $('#act-data :input').serialize();
    
  
   
    $.ajax({
           type: "POST",
           url: 'controllers/contacts.ajax.php',
           data: { subaction : "saveActDetails" , actForm : testAct},
           dataType: "json" 
        }).success(function (response) {
             
                 console.log(response)
  
      
        }).error(function (response) {
               console.log(" save-act error");
        });
}

Open in new window


so i use the post type,  i use the subaction to trigger the correct case, then im using the actFrom to send form data, now i want to be able to use this data to insert into a table. but im first seeing what i am posting, the return looks a match to the form however i dont think i can use it and add this to a table.


case 'saveActDetails' :

		$response = array(
			'Result' => 'save-act success',
			'data' => $_POST['actForm']
		);


		break;

Open in new window


any solutions ?
0
Angular Fundamentals
LVL 12
Angular Fundamentals

Learn the fundamentals of Angular 2, a JavaScript framework for developing dynamic single page applications.

I'm having dialog box with the upload files for the folder, when I'm selecting the multiple files (more than 25 files approx) for the upload, the dialog box getting increased the length to the bottom and scroll bar is not showing to scroll down to see the files fully.

Here is the screenshot:
dialog-box.png
Here I have added 36 files and when I want to see the uploaded file list its not showing fully and scroll bar also showing to scroll down to see the further.

Corresponding css style I have tried as:

div.upload-files-dialog {
 {
    position: absolute;
    max-height: 370px;
    height: auto;
    top: 0px;
    left: 226px;
    display: block;
    width: 270px;
    right: auto;
    bottom: auto;
 }

Open in new window


I have mentioned height as auto and max-height with some size, then also its not getting adjust with the screen.

The corresponding hbr file for the dialog is here:

{{#if view.showFileList}}
    {{file-list view.fileList}}
{{/if}}

Open in new window


The fileList of corresponding ember code is here:

        menuContext: null,

        formData: function () {
            if (!this.get('menuContext.formData')) {
                this.set('menuContext.formData', Ember.Object.create({ data: Ember.Object.create({ }), files: [] }));
            }
            return this.get('menuContext.formData.data');
        }.property('menuContext'),

        uploadHandle: null,

        showFileList: function () {
            return 

Open in new window

0
Talking to several people, it seems jquery has started to become a little less popular. I am curious if there is a technical reason for this, or if it is more of a it is just a little less popular?  Thoughts?
0
Any Recommendations on where to look to re order a list based on input, i have a list that has switches and what i am trying to do is some filtering to display checked switches

$("#check-sort-list").on('change', function() {
       var get_selected = $(this).val();
        
        alert(get_selected);
        
        if(get_selected == 1)
            {
                console.log(get_selected);
            }
        
        else if(get_selected == 2)
            {
                console.log(get_selected);
            }
        
        else if(get_selected == 3)
            {
                console.log(get_selected);
            } else 
                {console.log("No selection");}
    });

Open in new window



my list is just a normal html list with a label and a checkbox.
0
I am trying to send a text message (SMS) using email by using the telephone number, and the carrier specific suffix. For example, to send to a Boost Mobile customer, you would simply send an email to: 8135551212@myboostmobile.com - and it will send a text message to that number. Each carrier has its own suffix.

I have a list of carrier information:

Carrier            SMS gateway domain      
Alltel            [insert 10-digit number]@message.alltel.com      
AT&T            [insert 10-digit number]@txt.att.net      
Boost Mobile      [insert 10-digit number]@myboostmobile.com      
Cricket       [insert 10-digit number]@mms.cricketwireless.net
Project Fi      [insert 10-digit number]@msg.fi.google.com
Sprint            [insert 10-digit number]@messaging.sprintpcs.com      
T-Mobile      [insert 10-digit number]@tmomail.net      
U.S. Cellular      [insert 10-digit number]@email.uscc.net      
Verizon            [insert 10-digit number]@vtext.com      
Virgin Mobile      [insert 10-digit number]@vmobl.com      
Republic Wireless[insert 10-digital number]@text.republicwireless.com


Our C# driven site already has code set up to send an email.  We call the c# controller from Javascript like this:

var objToSend = {
     Email: "john@gmail.com",
     Body: "This is the body of the email",
     Subject: "Hello from our site."
}

// Call controller to send the email
$.post('/Contact/NotifyAdmin', objToSend);

Open in new window


So what I want to do is, re-use our existing code to send a text message.

Assuming I have the carrier and phone number available to me, how would I use our existing code?

var phoneNumber = "8135551200";
var carrier = "Verizon";

// Somehow I need to "build" the phone number in its correct format and pass as the "Email" property

// Then.. call our controller as normal

Open in new window


I think this is an ARRAY problem, isn't it? Can anyone help me get me going?

Thank you for looking.

Regards,

John
0
How to enable or disable radio button based on check box selection in Jquery ?

Check box click function is written inside the ready. function.

 $("#Other").on("click", function ()
    {
        if ($("#Other").is(":checked"))
        {   
            document.getElementById('Yes').disabled = false;
            document.getElementById('No').disabled = false;
        }
        else
        {
            document.getElementById('Yes').disabled = true;
            document.getElementById('No').disabled = true;
        }
    });
    $("#Other").trigger("click");

Open in new window

0
I have an interesting question

So i have an array build up of inputs like 10.

i need to display it on my front end correctly

here is the test sample frontend -

 <div id = "mobile-user-details" class="user-details__user-data border-top border-bottom p-4">
                      <div class="row">
                        <div class="col w-50">
                          <span>Mobile</span>
                          <span><?=$v_item['CONTACT_PHONE'];?></span>
                        </div>
                        <div class="col w-50">
                          <span>Landline</span>
                          <span><?=$v_item['CONTACT_LANDLINE'];?></span>
                        </div>
                      </div>
                        <div class="row">
                            <div class="col w-50">
                              <span>Email</span>
                              <span><?=$v_item['CONTACT_EMAIL'];?></span>
                            </div>
                            <div class="col w-50">
                              <span>Email</span>
                              <span><?=$v_item['CONTACT_EMAIL'];?></span>
                            </div>
                        </div>
                    </div>

Open in new window


here what outcome

fontend outcome
So what im trying to do is generate this from an array. the issue is im not sure how i can add a new div row wrap after every 2 results.
0
I wrote a simple checkout script for our page at work. When one of the more experienced developers looked at my code, he made a comment "we need to discuss you cleaning up your code"

Ok, so I am assuming he means to re-factor it, or take a more object approach.

Can anyone help me make this look a bit more elegant?  Any help would be appreciated. Maybe I can keep him off my back tomorrow!  :)

/** Document Ready */



jQuery(function ($) {

    jQuery.ajaxSetup({
        beforeSend: function () {
            $('#mmpc-loader').show();
        },
        complete: function () {
            $('#mmpc-loader').hide();
        }
    });

    // Form Submitted
    $( "#btnPurchase" ).click( function ( e )
    {

        e.preventDefault();

        Products = (sessionStorage.getItem("product") === "") ? sessionStorage.getItem("product") : "Solopreuner";

        // Hard Code Price
        let Price = 40;

        /* API Endpoints */
        let mmpcApi = "/Product/ProcessPayment";
        let authNetApi = "/Product/ProcessPayment";

        
        let Workstations = $( "#numWorkStations" ).val();   // Qty
        let total = 40 * Workstations;

        let valid = true;  // for future use when validating

        let FirstName = $( "#firstName" ).val();
        let LastName = $( "#lastName" ).val();
        let CompanyName = $( "#companyName" ).val();
        let Title = $( "#usrTitle" ).val();
        let Email = $( "#email" ).val();
        let Address = $( 

Open in new window

0
Twp questions on this page: https://www.gopherstateevents.com/results/cc_rslts/cc_rslts.asp

1) Why is there so much space above and below the horizontal list beginning with "Awards" and how can I minimize that?
2) If I used a data table for the Individual Results, would that increase, decrease, or have no impact on load time?

Thank you!
0
Inside my jquery button click event i have this date variable

var d = new Date();

But when I display the value inside variable d the format looks like this:

Fri Sep 07 2018 15:35:50 GMT-0700 (Pacific Daylight Time)


How do i format it to this format:  MM/DD/YYYY
0
Microsoft Azure 2017
LVL 12
Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

I'm trying to work with the Oxford Dictionary api to check whether words discovered in my app do actually feature in the dictionary.
Usually I make api calls using jquery and ajax, however this one doesn't receive client-side calls so I'm having to write it server-side in PHP and fire it using ajax from a javascript function.

I'm close, but I can't quite see how to include the authentication parameters in the url call, and my PHP is a bit sketchy at the best of times, so I'm hoping an expert here can help me to get the syntax right. At the moment, the response from the PHP file is simply: "Authentication parameters missing."  - So I'm sure its just my own ignorance about php and cURL holding it back. Can you help by showing me what changes to make in the PHP file below?

Any advice would be warmly received. Thanks...

This is how it looks so far:

For the JS:
function isDictionaryWord(pl){
    
    var isWord = false;
    
    pl = pl.toLowerCase();
    pl = pl.split(' ').join('_');
    
    $.ajax({
            url: "call_oxford_apia.php", 
            method: "post",
            data: { "word":pl},
                success: function(resp){
                    console.log("Oxford Check Shows: " + JSON.stringify(resp))
                    isWord = true;
                },
                 error: function() {
                     isWord = false;
                } 
    });
    
    return isWord;
}

Open in new window


And for the PHP: (filename: 'call_oxford_apia.php')


Open in new window

0
<button  id="bind-trigger"></button>

Open in new window



So i have this button

im trying to trigger it with js instead of a user click but no success.

$('#bind-trigger').trigger('click');
    
    $("#bind-trigger").on('click', function() {
        alert("Bind Triggered");
    
    });
    

Open in new window


i came acorss this online and it doesnt work but is it possible to trigger a click ?
0
how can I insert an html file into another html file using javascript or jquery?
1
Hi Guys,
I have an array and into the array i have another array

so I am trying to access to each row in the array and get his array so I ended up doing something like that but it doesn't work:
its never goes into my second loop.


   
for (var i = 0; i < VirtualDocument.length; i++) {
            debugger;
            for (var j = 0; j < VirtualDocument[i].length; j++) {
                debugger;
                var docs = VirtualDocument;
                c.pages.add(docs.pages.item(j))
            }
}

Open in new window

0
I have a ajax function which returns some json....

{
	"data": {
		"type": "slide",
		"id": "13",
		"attributes": {
			"slideID": 13,
			"slideGroupID": 1,
			"slideNumber": 2,
			"slideLocation": "Slide1.JPG",
			"slideLive": 1,
			"slideCurrent": 0,
			"slideHasVote": 0
		}
	}
}

Open in new window


How do I access the data using jquery. I need the slideLocation.
I thought this: console.log(data.attributes.slideLocation); but it doesn't work.
0
Recently a CDN we used went down, and our site malfunctioned.

Is there a way, using script, we can use the CDN if it's available ( if we don't get a 404 for example ), and if it's not, use a local version of our script?

Thanks!

John
0
Why am I stuck on this?! can't be that hard.

1. You can see the sample code here https://drive.google.com/open?id=1Z4CJc4mjOLZ8O8rCV3aqF2zaxrY3ZddA
Download and please just click on page.html

2.  You see the third filter.  You can click on "Add" and dynamically add rows.
f1.png
3. The third filter can be a text box or a dropdown.

4. I want to get the values of that third filter (dropdown or textbox), in order. The name is "FilterValues" and "camillatest" for the dropdown select.

5. I tried this and you can see it in Reporting.js but didn't work. I'll keep working on it and if I figure it out, I'll post back. So, I want to get value of textbox or the dropdown. Whatever the user has in the third filter.

var holdValues = []; //loop thru and add to this array

	$('.portfolio').each(function (index) {

		var val = $('#portfoliothirdfilter', this).find('select[name="camillatest"]').val()
		alert(val)
		var val2 = $('select[name="camillatest"]', this).val();
		alert(val2)
	});

Open in new window

0
Hi guys

I'm in the process of learning Sharepoint online. Along with that, I'm trying to set up a document management system for one of our departments. I've got membership to Pluralsight, but I find that the tutorials on there are not covering the content I am looking for.

I want to create an attractive dashboard, along with the ability for this department to upload content which then results in a table filled with details, like an Excel sheet that has columns. Above each of those columns will be a search column that when typed, will used jquery to filter the table in real-time as you type. Something like this:

https://sharepoint.stackexchange.com/questions/98599/search-box-above-every-column-of-list-in-sharepoint-2010

My point is, where do I start. Any decent tutorial sites that take you from the basics to the more complicated content?  Also, how long do you think it could take for something like this to be implemented with a beginner like myself?

Thanks for helping
Yashy
0
I have a job that I would like to get bids on...if that still happens on this site.  Here is what I need:

I need this page (https://www.gopherstateevents.com/results/fitness_events/results.asp?event_type=5&event_id=825&race_id=1427) to "scroll" vertically in marquee fashion for large screen display at races.  All I really need is the data table...or the data in the data table...to be visible.  Please let me know if you would be able to help me and what it would cost me.  I have tried to get this going in the "normal" process of doing it myself with EE help but, due to my weakness in JQuery, I just haven't gotten there.

Let me know if you have questions or if you can help me.
0
Become a CompTIA Certified Healthcare IT Tech
LVL 12
Become a CompTIA Certified Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

bootbox.confirm("Are you sure you wish to change this field?", function(result)
                    { 

                         

                    });
             
             
                        $.ajax({
                            type: "POST",
                            url: 'set-field-value.php',
                            data: formData,
                            processData: false,
                            contentType: false,
                            dataType: "json" 
                        }).success(function(response){
                            console.log(response);
                   

                        }).error(function (response) {

Open in new window



So above is start of a function i have which will update fields but i am doing some valuation. the bootbox brings up a dialog with message and two buttons which sets a result either true or false. im wondering how do i within that dialog function proceed to ajax is true and stop function and not reach ajax if false.
0
Hi,

I am trying to read the value of the radtext box. It comes out empty.

Anything wrong with this code?



var Addr1 = $find("<%= txtAddr1.ClientID %>");
addr1Text = Addr1.get_value();
alert("Addr1Text: " +  addr1Text );

 <telerik:RadTextBox ID="txtAddr1" runat="server" OnTextChanged="txtAddr1_TextChanged" AutoPostBack="false">
                </telerik:RadTextBox>

Open in new window

0
This can't be that hard. I don't know what I'm missing but been working on this off hours (from work) for two nights now...

I'll go step by step. Issue is: I click on submit but the controller is not called. I googled and googled and haven't found the answer to this...

I can upload the code to google drive, if needed. There's no database behind it. It's just a prototype/sample code I'm setting up.

1. I'm setting a sample MVC project to try out a new theme I got from Themeforest.net
2. Routconfig.cs looks like this

public class RouteConfig
	{
		public static void RegisterRoutes(RouteCollection routes)
		{
			routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

			routes.MapRoute(
				name: "Default",
				url: "{controller}/{action}/{id}",
				defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
			);
		}
	}

Open in new window


2. In views/home/index, I have this

@using (Html.BeginForm("Index", "NewInside", FormMethod.Get))
					{

<button class="btn green" type="submit" >Sign In</button>
								@*@Html.ActionLink("Sign In", "Index", "NewInside")*@
.............
}

Open in new window


3. In NewInsideController, I have this
[HttpGet]
                //public ActionResult Index(string Portfolio,  string Culture, string username, string password)
		public ActionResult Index()
		{
		    ViewBag.test = "test";
            return View();
        }

Open in new window


And views/newinside/index.cshtml is this

@{
	//Layout = "~/Views/Shared/_Layout.cshtml";
	ViewBag.Title = "Index";
}

@ViewBag.test

Open in new window


4. in _Layout.cshtml, I have this

<html>
<head>
	<meta charset="utf-8" />
	<meta name="viewport" content="width=device-width" />
	<title>@ViewBag.Title</title>
</head>
<body>
@RenderBody()
</body>
</html>

Open in new window


5.  In _viewstart.cshtml, I have this

@{
    Layout = "~/Views/Shared/_Layout.cshtml";
}

Open in new window


This happens

1. I click on submit but code doesn't stop at NewInsideController's Action. I tried Post, Get, tried ActionLink. Tried the Action controller with parameters. Nothing worked.

This works
If I change @using (Html.BeginForm("Index", "NewInside", FormMethod.Get)) to this @using (Html.BeginForm("Index", "Home", FormMethod.Get))

What's going on?
0
 var formData = new FormData();

Open in new window


Cant seem to find what this is on the web,

anyone explain this statement and how to debug and see its values?
0
I'm developing an ASP.NET Core 2.1 MVC WebApp. In a View which is form for creating a meeting (think outlook's create meeting), I'm allowing the user to dynamically add meeting attendees, which are displayed on the form by injecting the input from a modal popup as table tr/td for FirstName, LastName, Email. See below code.

These entries are added based on a modal popup on the page...
            
   var n = "<tr data-fn='" + fn + "' data-ln='" + ln + "' data-em='" + em + "'><td>" + fn + "</td>" + "<td>" + ln + "</td>" + "<td>" + em + "</td></tr>";
   $("#attendee-list tbody").append(n);

Open in new window


On HTTPPost, I have the below code to populate a ViewModel List with above table values, but this is all client side. I feel this has security holes if someone decides to manipulate the javascript before the post hits the server.

I'm always looking to implement best practices and I have a feeling this client side JS can be manipulated by someone before the post hits the server. Some things are still new to me and just because it works doesn't mean it's good code! Is this approach for populating my ViewModel's List appropriate, or Is there a better approach other than validating entries client-side and then server-side?

$("#form-submit").on("click", function () {
    var i = 0;
    $("#attendee-list > tbody > tr").each(function () {
        var fn = $(this).data("fn");
        var ln = $(this).data("ln");
        var em = $(this).data("em");

        

Open in new window

0
I am sure this is an easy question, thank you very much for any direction.

I am having some trouble figuring out how to add edit controls to a subgrid, using free-jqgrid. I have the parent grid set up and has working controls.  I have the subgrid correctly displaying data but It seems I am not adding the subgrid controls correctly. Do yall know any examples i can reference to set up an editable subgrid?
0

jQuery

17K

Solutions

5K

Contributors

jQuery (Core) is a cross-browser JavaScript library that provides abstractions for common client-side tasks such as Document Object Model (DOM) traversal, DOM manipulation, event handling, animation and Ajax. jQuery also provides a platform to create plugins that extend jQuery's capabilities beyond those already provided by the library.

Related Topics