Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x

jQuery

16K

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

Hi I am trying to run this following code to read the JSON values.

I am getting 200 ok message but it only error code is executed.

what is wrong with this code?

var _formURL = 'http://www.json-generator.com/api/json/get/bOAWgfEMuq?indent=2';

	//call for API
	$.ajax({
	  type: 'POST',
	  url: _formURL,
	  dataType: 'jsonp',
    data: {},
	  contentType:'application/json; charset=utf-8',
	  success: function(data) {
	    validateResponsedata (data);
	  },
	  error: function(data) {
	    validateResponsedata (data);
	  }          
	});

	var validateResponsedata = function (data) {
	 alert(data.responseText);
	};

Open in new window


Any help appreciated.

I want to read the items inside the JSON.

Thanks
0
Upgrade your Question Security!
LVL 11
Upgrade your Question Security!

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

Hi Experts,

Can anyone tell me why the following executs twice in a row for every click.  For example, the alert('Please choose the desired time slot to book.');

I get 2 consecutive alerts when the slot is actually empty (when I place a breakpoint it will execute twice); and when slot is not empty, the entire function will run as expected, and then the alert will come up once.

I placed e.preventDefault(), but it is not a fix

The function is

    $('#btnApptBook').on('click', function(e){
       
       e.preventDefault();
       var slot = $('#slots').val(); 
       var proceed = validateClient();
       
       //Check Google-Specific Requirements
       if (proceed){
           
            if ((slot === '') || (slot == null)){
                alert('Please choose the desired time slot to book.');
                proceed = false;
                return false;
            }            
        }
        
        if (proceed){
            
            var gmail_id = $('#gmail_id').val();
            var client_id = $('#id').val();
            var duration = $('#duration').val();
                    
            var slot_id = $('#slots').val();
            var fn = $('#first_name').val();
            var ln = $('#last_name').val();
            
           var google_path = PATH_TO_ROOT + 'utilities/google_calendar/index.php?ajax_call=';
           
           if (gmail_id === ''){
               google_path += 'book-appt';
           } else {
              

Open in new window

0
Time to get some help because this the 3rd day that I'm trying to figure out what I'm missing

1. I'm following this example ng-idle example
I found other examples as well and this is another Another example

2. You can see it here. I have the "start demo" button on the front page
http://147.75.0.124:88/

3. In module.js, I have this. I step thru it and I see 'Idle' is defined

(function() {
    'use strict';

    angular.module('lawApp', ['ui.bootstrap', 'ngIdle'])
    .config(["IdleProvider", "KeepaliveProvider", function (IdleProvider, KeepaliveProvider) {
        IdleProvider.idle(5);
        IdleProvider.timeout(5);
        KeepaliveProvider.interval(10);
    }])
        .run(['Idle', function (Idle) {
        Idle.watch();
    }]); //['ui.bootstrap']  I moved this to login page and it works fine. Having it here and not having it in the login page also works

  
})();

Open in new window

4. I put the rest of the code from the demo in logincontroller.js

 function loginController($scope, loginService, $uibModal,Idle,Keepalive)
   {
       .....

            //*** idle

       $scope.started = false;

       function closeModals() {
           if ($scope.warning) {
               $scope.warning.close();
               $scope.warning = null;
           }

           if ($scope.timedout) {
               $scope.timedout.close();
               

Open in new window

0
Head out to http://brucegust.com/eResume/

In the upper right hand corner, there's a little downarrow button that you can click on that reveals some content. When you click it, the arrow changes to "up." I want to change it back to "down" when the user clicks on it again to minimize the expanded content.

How?

You can see where I started in my code with this:

$('#instructions').click(function(event){
		event.preventDefault();
		//$("#the_button").attr("src", "images/minimize_button.png");
		var src = $('#the_button').attr('src');
		if(src="images/expand_button.png")
		{
			$("#the_button").attr("src", "images/minimize_button.png");
		}
		else
		{
			$("#the_button").attr("src", "images/expand_button.png");
		}
		$('#instruction_row').slideToggle(300);
	});

Open in new window


I think I'm close, but I got stuck.

Thanks!
0
Hi Experts

Could you point what is preventing this code to correctly fire a javascript function when a 2nd input box is added ?

<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/4.0.5/handlebars.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/zepto/1.1.6/zepto.min.js"></script>
<script src="../lib/php_crud_api_transform.js"></script>
<script id="PostListTemplate" type="text/mustache">
<ul>
	{{#pessoas}}
		<li>
			<span class="id">{{id}}</span>, <span class="clb_nome">{{clb_nome}}</span> , <span class="email">{{email}}</span> 
			<a href="javascript:void(0)" class="edit">editar</a>
			<a href="javascript:void(0)" class="delete">deletar</a>
		</li>
	{{/pessoas}}
	<li>
		<form>
            <input name="clb_nome"/>

             <!-- Problematic if I add this input box -->
            <input name="email"/>

		</form>
	</li>
</ul>
</script>
<script>
function PostList(element, template) {
	var self = this;
	var url = '../api.php/pessoas';

	self.edit = function() {
		
        // Edition
        
        var li = $(this).parent('li');
		var id = li.find('span.id').text();
		
        var clb_nome = li.find('span.clb_nome').text();
		clb_nome = prompt('Value',clb_nome);

        var email = li.find('span.email').text();
		email = prompt('Value',email);

		if (clb_nome!==null) {
			$.ajax({url:url+'/'+id, type: 'PUT', data: {clb_nome:clb_nome, email:email} , success:self.update});
		}
	};

	self.delete = function() {
		var li 

Open in new window

0
Hi,
I use Dropzone to upload the files to the site.
http://www.dropzonejs.com/#events

  
			<form id="upload" method="post" action="Docs.aspx" enctype="multipart/form-data">
			<div id="drop">
				Drag & Drop Here

				<a>Browse</a>
				<input type="file" name="upl" multiple />
			</div>

			<ul>
				<!-- The file uploads will be shown here -->
			</ul>

		</form>

Open in new window

this is the code behind

    protected void Page_Load(object sender, EventArgs e)
    {
        



        bool exists = System.IO.Directory.Exists(Server.MapPath("~/DocStorage/File-" + Session["sCMID"]));
        if (!exists)
            System.IO.Directory.CreateDirectory(Server.MapPath("~/DocStorage/File-" + Session["sCMID"]));

        DirectoryInfo flDis = new DirectoryInfo(Server.MapPath("~/DocStorage/File-" + Session["sCMID"]));

        foreach (string s in Request.Files)
        {
            HttpPostedFile file = Request.Files[s];
            int fileSizeInBytes = file.ContentLength;
            string fileName = file.FileName;
            string fileExtension = "";


            if (!string.IsNullOrEmpty(fileName))
                fileExtension = Path.GetExtension(fileName);
            string savedFileName = Guid.NewGuid().ToString() + fileExtension;
            //string savedFileName = fileName;

            string filename = Server.MapPath("~/DocStorage/File-" + Session["sCMID"] + "/" ) + savedFileName;
            

            file.SaveAs(filename);
            
        }

Open in new window

0
when hover want to open the only nearest or first div when hover on class firsthd
<!DOCTYPE html>
<html>
<head>
	<title>Adjustment</title>

	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
	<link href="https://cdn.datatables.net/1.10.13/css/dataTables.bootstrap.min.css" rel="stylesheet" type="text/css" />
	<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.7.5/css/bootstrap-select.min.css">
	<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.7.5/css/bootstrap-select.min.css">
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
	<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/angular_material/1.1.0/angular-material.min.css">
	<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css" />
	
	<link rel="stylesheet" type="text/css" href="css/treeview.css" />
   <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
   <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

<script type="text/javascript">
$(document).ready(function(){
$('firsthd').mouseenter(function(e){

$('.div1').css("top",e.pageY-50+"px"); 
$('.div1').css("left",e.pageX+"px"); 

Open in new window

0
Hi,

I am using colobox
http://www.jacklmoore.com/colorbox/
		<script>
            $(document).ready(function () {
                //Examples of how to assign the Colorbox event to elements
                $(".iframe").colorbox({ iframe: true, width: "80%", height: "40%" });
                $(".callbacks").colorbox({
                    onOpen: function () { alert('onOpen: colorbox is about to open'); },
                    onLoad: function () { alert('onLoad: colorbox has started to load the targeted content'); },
                    onComplete: function () { alert('onComplete: colorbox has displayed the loaded content'); },
                    onCleanup: function () { alert('onCleanup: colorbox has begun the close process'); },
                    onClosed: function () { alert('onClosed: colorbox has completely closed'); }
                });


                //Example of preserving a JavaScript event for inline calls.
                $("#click").click(function () {
                    $('#click').css({ "background-color": "#f00", "color": "#fff", "cursor": "inherit" }).text("Open this window again and this message will still be here.");
                    return false;
                });
            });
		</script>

Open in new window

In the page, I use this to open up the window
<li><a href="mypage.aspx?CMCID=new" class="iframe">Contact</a></li>

Open in new window


Is there a way to do the same thing from javascript? What I am doing is using GridView in a .net and use LinkButton to send the ID back to code behind, then send back that ID back to .net Javascript to use Colorbox

<asp:LinkButton ID="LinkButton4" CommandArgument='<%# Eval("ID") %>' CommandName="Link" runat="server" Visible="true" HeaderStyle-Width="10%"><%# Eval("ContactName")%></asp:LinkButton>

Open in new window


Sorry, I am sure there are better ways. But this is the only way I know..thanks
0
I am using the below ajax to get some JSON from an API. Can someone tell me how I can add a timeout to this function? The fail only works if it fails the call right away.

Thank you.

  $.getJSON(foursquareURL).done(function (info) {
    var results = info.response.venues[0];
    if (typeof self.URL === 'undefined') {
      self.URL = '';
    }
    else {
      self.URL = results.url;
    }
    self.street = results.location.formattedAddress[0] || '';
    self.city = results.location.formattedAddress[1] || '';
    self.phone = results.contact.phone || '';
  }).fail(function () {
    $('.list').html('Error.');
  });

Open in new window

0
I have a hidden field that is populated when a user clicks on a jquery autocomplete form.

I need to pass this value so its stored in and displayed on the page...Im guessing a lable is appropriate as I only need to display the value.

I will use the value later to build an insert statement.

so I have some html for a lable
 <table id="new-row-template" style="display:none">
        <tbody>
            <tr>
                <td><label></label> 
                </td> 
                <td>

Open in new window


I have some html that gets the autocomplete

 <div class="col-md-2">
                @Html.TextBoxFor(x => x.SearchEntityNameOrId, new { @type = "text", @placeholder = "Search", @class = "caAutoComplete_EntityEntityNameSearch", @style = "width:100%!important;" })
            </div>

Open in new window



and here I stored the value in autocomplete to the hidden field

    $(".caAutoComplete_EntityEntityNameSearch").autocomplete(
        {
            source: "@Url.Content("~/Shared.mvc/EntityEntityNameSearchAuto")",
            minLength: 3,
            select: function (event, ui) {
                var inputlabel = ui.item.label;
                var inputvalue = ui.item.value;
                $("#hdnClientId").val(inputlabel);
                addNewRow();
             return false;
            }
        });

Open in new window

0
Technology Partners: We Want Your Opinion!
Technology Partners: 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!

I've recently taken over the development of a web form that uses JQuery based form field validation:

https://www.evergladesholidaypark.com/ehp-landingpage-markup/

The problem that I'm having is that the form field validation that's currently in place appears to be compleley ignoring form fields that have the "tel" field type:

<input type="tel" name="field-payment-security-code" id="field-payment-security-code" value="" placeholder="Security Code" data-required="true">

Open in new window


How can I update the javascript so that it recognizes these types of fields and applies the required field checking to them?  

My javascript code is below.  Any help would be appreciated.

Thanks!
- Yvan

;(function($) {
	'use strict';

	var FormValidation = (function() {
		var Validator = function($field, $fields) {
			this.$field = $field;
			this.$fields = $fields;
		};

		Validator.prototype = {
			reg: {
				email: '^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$',
				number: '^[0-9]+$'
			},

			checkField: function() {
				return {
					state: this.run(),
					$fields: this.$field.add(this.additionalFields)
				}
			},

			run: function() {
				var fieldType;

				switch (this.$field.get(0).tagName.toUpperCase()) {
					case 'SELECT':
						fieldType = 'select';
						break;

					case 'TEXTAREA':
						fieldType = 'text';
						break;     

					default:
						fieldType = this.$field.data('type') || this.$field.attr('type');
				}

				var functionName = 'check_' +

Open in new window

0
Hi,

I have little problem with date picker in html input field.
When I choose date from picker it show in this format: dd.mm.yyyy but when that record save to database MySQL shows like this:
yyyy-mm-dd , what is the best way to make this working, to write in database date in this format dd.mm.yyyy

there is html:

<label>Date of birth:</label>
<input type="date"  class="form-control" name="date_birth" required />

Open in new window




EDIT:

I am fix that using date("d.m.Y",strtotime($_POST['datum_rodjenja']));
1
Hi Experts

Could you point what is wrong with this .json structure?

films.txt

(Please rename it to films.json)

In a manner it couldn't be saved in a .php file, accordingly to:

img001
Thanks in advance!
0
I've got a jQuery toggle on this page:

http://sandbox.intrepidrealist.com/cazoozsb/test-page/

I'm not sure what's causing it to be dead in the water. It works in the example:

https://codepen.io/derekjp/pen/pPqwXJ
0
I had this question after viewing Duplicating DIVs and nested elements.

Building on Julian's answer for cloning my DIV, I also added a Clear File button, as follows
            <div id="divAttachNew">
                
                <label class="lblAutoWidth">
                    <span class="fa fa-paperclip"></span>
                    Attach New Files</label>
                <span>(maximum file size: <?php echo $env['upload_size_mb']; ?> MB)</span>
                
                <div id="divAttachFiles">
                                        
                    <input type="file" id="file[]" name="file[]" class="attachFile">                    
                    <input type="button" class="btnClearFile" 
                           id="btnClearFile[]" name="btnClearFile[]" value="Clear File">
                    
                </div>

            </div>            


        <div id="divAttachAdditional">
            <span class="fa fa-plus-circle"></span>
            <a id="aAddFiles">Attach Additional files</a>
        </div>

Open in new window


And my jQuery is
    $('#aAddFiles').on('click', function(e){
        e.preventDefault();
        $('#divAttachNew').append($('#divAttachFiles').clone());
    });
      
    $('.btnClearFile').on('click', function(){
       
        console.log($(this));
        
    });

Open in new window


So now I have 2 questions.

1- When clicking #btnClearFile, only the first button produce output, the others do not. Why?

2- How  would I determine which  of thhese buttons is clicked, and would remove that corresponding DIV?

Thank you.
0
I have a datatable that is loaded on my page....and I just need to insert a row so my user can input data and save. I cannot  seem to make this happen....

Here is the jquery table referenced in the view:  I would think I could reference that table since its already loaded on page but having no luck.  Please help.

The columns that are rendered with existing data are Entity, Role, Designate, Allocation

within the jquery grid I am dynamically pulling the data ...Entity would be autopopulated, Role would load a dropdown, designate would load a drop down, and allocation would be a input for decimal values.  Then there would be an save and cancel button


<div class="col-xs-12">
        <div class="row" style="margin-bottom:4px;">

            @BootstrapHelper.Panel("GenericGrid-panel", BootstrapPanelCssClass.Primary, @Model.HeaderTextLeft, "",
                        false, @Model.Icon, "GenericGrid-panel-body", "",
                        @<text>

                            <div id="contactEntity-crud-div" class="col-xs-12" style="float:left;display:block">
                                test
                                <div id="main-container-contactEntity" class="container-fluid">

                                    <table id='contactEntity-crud' class="display" style="width:100%;"><tbody></tbody></table>
                                </div>
                            </div>
                        </text>, "", "",@<text>  </text>)




        

Open in new window

0
Lets assume I have a javascript method called createrow(dt, table)

I would like to call that when a user selects an item in my jquery autocomplete.

Ultimately what I need to do  is actually create a row in my jquery datatable when this happens..but I will make this function call do that  ....

Can someone help me with wiring this up..assuming the  method createrow(dt,table)

Here is my autocomplete code in my view in the scrips section

 $(".caAutoComplete_EntityEntityNameSearch").autocomplete(
        {
            source: "@Url.Content("~/Shared.mvc/EntityEntityNameSearchAuto")",
            minLength: 3,
            select: function (event, ui) {
                var inputlabel = ui.item.label;
                var inputvalue = ui.item.value;
                $("#hdnClientId").val(inputlabel);

             return false;
            }
        });

Open in new window


Here is where I use it in html:

<div id="main-container" class="container-fluid">
    <div class="col-xs-12">
        <div class="row" style="margin-bottom:4px;">
            <div class="col-md-1">
                <span style="font-size:11pt;font-weight:bold;">Entity Name:</span>
            </div>
            <div class="col-md-2">
                @Html.TextBoxFor(x => x.SearchEntityNameOrId, new { @type = "text", @placeholder = "Search", @class = "caAutoComplete_EntityEntityNameSearch", @style = "width:100%!important;" })
            </div>

        </div>
    </div>

Open in new window

0
Here's the page: https://www.stadriemblems.com/products/custom-enamel-pins/

As you can see on this page, I have text overlayed on this hero image, and in the code you'll see that the placement is defined as such

data-x="['-350','left','center','center']"

There are four different breaks where it changes. The problem is that the largest size is just too broad. If you start resizing the browser window, it doesn't take long for the text to get cut off on the left because it's still obeying the -350 requirement, (Note that I have a 27" 4k monitor).

Is this pulling from the master bootstap media query definitions? If so, is there a way to override it and define the breaks right in this code?

Also, is there a way to control which section of the image is displays at different screen sizes? When you shrink it down to phone size, all you really see is the woman's hand.

Am I making an sense at all?
0
I have the following ajax call and controller.   I am getting the error message indicating
the parameters dictionary contains a null value for parameter "allocation" of non nullable type decimal for method system.web.jsonresult UpdateContactEntity(System.string, system.decimal,system.string,system.string) in contact controller.  An optional parameter but be a reference type, a nullable type, or be declared as an optional parameter.

Here is my ajax:  Note all the alerts pull a value..so this must be in the ajax call itself..perhaps with url

function UpdateContactEntity(clientxcontactId) {
    var allocation = $("#txtAllocation_" + clientxcontactId).val();  
    var role = $('#selectRole_' + clientxcontactId +' :selected').text();  
    var designate =  $('#selectDesignate_' + clientxcontactId +' :selected').text(); 
    alert(allocation); 
    alert(designate);
    alert(role);   
    alert(clientxcontactId);
   $.ajax({
        url: "/Contact.mvc/UpdateContactEntity/ " + clientxcontactId + "?allocation=" +  allocation + "?role=" +  role + "?designate=" +  designate,
        type: 'GET',
        cache: false,
        dataType: 'json',
        data: { data: clientxcontactId },
        success: function (data) {
                var result = $.trim(data.Result);              
                ShowGridRedraw();
                },
        error: function (request, status, error) {
        alert(request.responseText);
        }     
     });
}

Open in new window


And here is the call to the controller:

[System.Web.Mvc.HttpGet]
        public JsonResult UpdateContactEntity(string id, decimal allocation, string role, string designate)
        {
            var result = true;
            int clientxcontactId = id.ToInt32();

            IContactEntityEditService contactEntityEditService = DependencyResolver.Current.GetService<IContactEntityEditService>();

            var updated = contactEntityEditService.UpdateContactClient(clientxcontactId,allocation, role, designate);

            result = updated;
            return Json(result, JsonRequestBehavior.AllowGet);
        }

Open in new window

0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE
LVL 5
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Hi Experts,

I have an array of <input type="file" name="file[]" id="file[]">, and I am wondering how can I extract the name and size of the selected files?

So far I have the below, and for the first file, file[0], I need to get
name = "test - Copy.txt"
size = 16

As you will you will see from my output
Files.JPG
File-0.JPG
0
I am trying to make an ajax  call...that will grab the values off the page...and then pass those values in the URL to the controller.

Here is the ajax...its crapping out on the 2nd line starting with var allocation.

function UpdateContactEntity(clientxcontactId) {
    var allocation = $("#txtallocation" + clientxcontactId + ).val();
    alert(allocation);       
   $.ajax({
        alert("test");
        url: "/Contact.mvc/UpdateContactEntity?clientxcontactId=" + clientxcontactId + "?allocation=" +  allocation,
        type: 'GET',
        cache: false,
        dataType: 'json',
        data: { data: clientxcontactId },
        success: function (data) {
                var result = $.trim(data.Result);              
                ShowGridRedraw();
                },
        error: function (request, status, error) {
        alert(request.responseText);
        }     
     });
}

Open in new window


For greater detail here is the other parts of my code:
Here is where I call it.

     [System.Web.Mvc.HttpGet]
        public JsonResult UpdateContactEntity(string data,int allocation)
        {
            var result = true;
            int clientxcontactId = data.ToInt32();
            IContactEntityEditService contactEntityEditService = DependencyResolver.Current.GetService<IContactEntityEditService>();

            var updated = contactEntityEditService.UpdateContactClient(clientxcontactId,allocation);

            result = updated;
            return Json(result, JsonRequestBehavior.AllowGet);
        }

Open in new window

0
Hi Experts,

When the user cclicks on a button, using jQuery, how can I duplicate an entire DIV with its elements?

For some elements, at design time I want to have
<input type="file" id="fie[0]" name="file[0]">

Open in new window


...and when duplicating, I would need the [index++] updated, so that it would be an nested array in my $_POST

Thank you
0
Here's my function:

function spanishAlertYes(check)
	{
		//at this point, if the user clicks on this option, their changing their minds. If they said they needed a Spanish option, this will be checked by default. 
		//if they do change their minds, then everything they might've entered as far as "employee / spouse" values will be zeroed out and they'll be starting all over again as if they just completed their basic aesthetics
		if(check.checked)
		{
			$('.submit_class').hide(100);
			$('#submit_explanation').html("");
			$('#emp_spouse_no').prop('checked', false);
			$('#emp_spouse_yes').prop('checked', false);
			$('.employer_options').show(100);
			$(".employee_spouse_name").hide(100);
			$('#homepage_text_one').html('will I get this to work');
		}
	}

Open in new window


Everything works just fine with the exception of the fact that I want to clear out whatever might be in the "homepage_text_one" field and replace it with "will I get this to work."

What's happening is that the user is backtracking. They've put a value in the "homepage_text_one" textarea, but now they're changing their minds as is evidenced by them having clicked on the radio button that triggers the above function.

What am I missing?
0
Hi Experts,

Can any one help me get started to work with files in PHP?

For example, in order to upload a file, I think I need <input type="file">? I also think I need to add something to my <form> tag for this?

Finally, once submitted, how can I...
if folder/sub-folder !exist {
  create folder/sub-folder
}
save file as folder/sub-folder/filename

Open in new window


Thank you!
0
My user has just submitted a form and, based on the input they've just entered, a box is going to be checked by default like this:

<input type="checkbox"  name="spanish_alert_yes" id="spanish_alert_yes" onchange="spanishAlertYes(this)" value="Y" checked>

Here's a screenshot:

screenshot
On the original form, I've got a little "interview" that's revealed in stages based on the way in which the user checks certain boxes. Should the user click on "yes" in response to the first question ("Will this Employer need a Spanish version and an English version? Check "yes" in the box to the right if you do..") , the "spanishAlertYes" function is triggered and it looks like this:

	function spanishAlertYes(check)
	{
		if(check.checked)
		{
			$('.submit_class').show(100);
			$('#spanish_alert_no').prop("checked", false);
			$('.employer_options').hide(100);
			$('#submit_explanation').html("<br><div style=\"width:95%; margin:auto; text-align:center; border:1px solid #cccccc; border-radius:10pt; padding:10px;\">When you click on \"Submit,\" you will be creating the basic aesthetics of your user's landing page. From here, you'll be directed to another interface where you'll being creating the user's Landing Page experience in Spanish.</div>");
		}
		else
		{
			//if this isn't checked, should the user have proceeded past this point and then backtracks and unchecks this button, you need to uncheck and zero out every checkmark that may have been put in place
			

Open in new window

0

jQuery

16K

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