Javascript – How to Open a Modal Sidebar (Bootstrap) in Another Modal – Asp.net MVC

I have a generic modal window that works perfectly for CRUD in my WEB application. I'm trying to open another modal (sidebar) window so that it stays to the right of the generic modal, but it does not work … It seems like the two modal windows are merging and when I click the CLOSE button in the last window Can anyone help me?

Modal Generic:


Modal sidebar:

sidebar

...

JS script:

$ (Document) .ready (Function () {
$ .ajaxSetup ({cache: false});
// search the elements of the data-modal attribute and write them into the click event
a[data-modal]& # 39;) .on (& # 39; Click & # 39 ;, Function (s)
startTimer ();
// Opens the modal window with the requested form
openmodal (this.href);
return false;
});

$ & # 39; table & # 39 ;. a (& # 39; click & # 39 ;, & # 39; a & # 39;[data-modal]& # 39 ;, function (s) {

// This treatment adjusts modal deletion
// if (this.id == & nb; btnExclude & # 39;) {
// $ (".modal-dialog"). addClass ("modal-lg");
// $ (".modal-dialog"). addClass ("modal-danger");
//}
startTimer ();
openmodal (this.href);
return false;
});

$ (& # 39; # modalGeneric & # 39;). on (& # 39; hidden.bs.modal & # 39 ;, function () {
$ (& # 39; # contentModal & # 39;). html (& # 39; & # 39;);
});

// This event causes the page not to be sent when you press the Enter key
$ (document) .on (& # 39; keystroke & # 39 ;, function (s) {
if (e.keyCode == 13) {
e.preventDefault ();
}
});

dataTablePrincipalLoad ();
});

Function Openmodal (URL) {
// Request a request and load the form into the modal window
$ (& # 39; # contentModal & # 39;). load (URL, function () {
$ (& # 39; # modalGeneric & # 39;). modal ({
Keyboard: true
}, & # 39; show & # 39;);
// Send focus to field description
//$('#modalGenerica').on('shown.bs.modal&function= (event) {
// // $ ("# txtCompleteName"). focus ();
//});

// Enter the submit event
bind Form (this);

endTimer ();
});

}

Function bindForm (dialog) {
// Inserts the form with the submit event into the modal window
$ (& # 39; form & # 39 ;, dialog) .submit (function (e, i) {
if ($ (this) .valid () || i) {
// make an ajax request
$ .ajax ({
URL: this.action,
Type: this.method,
Date: $ (this) .serialize (),
Success: Function (Result) {
// If the request is satisfactory, reload the current page
if (result.success) {
window.location = window.location;
} else {
$ (& # 39; # contentModal & # 39;). html (result);
bindForm ();
}
}
});
return false;
} else {
return false;
}
});

NOTE: To call modalSidebar from Generic, I use the button:


A hug to all !!!

Javascript – Select an element from a modal and add a selection multiple

I have to develop a solution for a component Select several, If you click a button next to this component, a modal must be opened to select the values ​​and then add them as follows:

1 – component

Insert here the description of the picture

2 – modal

Insert here the description of the picture

3 – Elements selected in the component

Insert here the description of the picture

Modal mode (Figure 2) will open after you click the magnifying glass on the right side of the Figure 1 component. One or more elements can be selected so that the result is similar to that of Figure 3.

This is an example of a website I have seen on the internet, but I have not found a source code that will allow me to do so.

Javascript – modal window is only opened and not closed

I have a modal window in a div. When I mouse over it, I make the div color and open a modal window with a photo. The problem is that this modal window just opens and just does not close. Someone can help me, I do not know who else to turn to.



   

And here's the code for the div and modal window.

System logo

Home screen

A secure company with your data, protected and to create a faster information network!

X

Javascript – change the href attribute in a bootstrap modal

I have a bootstrap modal for which I change the content for 9 different elements (depending on what the user clicks). Right now, I can change the title and description scope of each modal, but I'm having trouble modifying the modifier's "href =" attribute.

Here is my HTML modal code

   

This is the image the user clicks to activate the modal (in total I have 9)


And JQuery

$ ("# exampleModal"). on ("show.bs.modal") function (event) {
var button = $ (event.relatedTarget);
var receiver = button.data ("whatever");
var info = button.data ("Description");

var modal = $ (this);
modal.find (".modal-title"). text (recipient);
modal.find (".modal-body p"). text (info);
});

So my JQuery extracts the data and data from the img and inserts them into the modal with my JQuery. I could not find a way to target the href attribute of the Visit Site link in bootstrap modal code. I've tried to add a new data link with my desired URL, but this only changes the text and does not set the actual link.

Javascript – modal that appears once

See if that's what you need:



   
   
   
   
   

   document
   
   
  

    

  

At first, I specified the variable modalJaAberta with value not correct, This means that you automatically get the value after loading your page not correct,

When calling the function openmodal ()the value of this variable is checked. If the value is not correcta modal opens and updates the value of the variable in true,

The next time you call the function openmodal ()the function does not work. Because the value of the variable will be true,

PS: I have the stylized modal to work on it snippet: style = "display: none;", I assume your project is doing it over CSS,

Usability – modal or new page for product description?

After reading your question and the thread you are referring to, I would say, "Go to new page," for the following reason:

  • If the user wants to compare multiple products (recipes), he can open them in separate browser windows / tabs and perform the comparison

This is not possible when using modals because the modal dialog blocks all underlying UI components.

However, this would work as a kind poor man Comparison function that should actually be implemented on your page.
I agree with the accepted answer of your referral thread – go with an extensible list, a.k.a. Accordion. Or better yet, provide a fixed area where the current recipe is displayed while the user can scroll through the other recipes. In the fixed area you can see some links like add to the comparison, open in a new window and Printable version, see the following model:

mock up

Download bmml source – Wireframes created with Balsamiq Mockups

javascript – How to Load a Spinner in a Modal During Ajax Requests (GET) – Asp.net

I have a page index with a grid listing CEPS. I'm using modals windows to edit, delete, and create a new registry. When I click the Edit button, it takes about three seconds for the modal to appear. This is due to the search time of the bank record. I would like to load a "spinner" into my index to block the screen from loading and then disappear when the edit mode is displayed.
Currently, my spinner opens in a DIV, but he can be changed into a modal … I accept suggestions … Can someone help me to help me?

A hug to all! πŸ™‚

Insert here the description of the picture

Insert here the description of the picture

Spinner CSS:

.loading {
Align text: center;
}

Charging period {
Display: inline block;
align vertically: center;
Width: 10px;
Height: 10px;
Margin: 50px car;
Background: black;
Boundary radius: 50px;
-webkit-animation: loader 0.9s infinite alternative;
-moz-animation: loader 0.9s infinite alternate;
}

Charging time: nth of type (2) {
Web Kit Animation Delay: 0.3s;
-Moz animation delay: 0.3s;
}

Charging time: nth of type (3) {
Web Kit Animation Delay: 0.6s;
-Moz animation delay: 0.6s;
}

@ -webkit-keyframes loader {
0%
Width: 10px;
Height: 10px;
Opacity: 0.9;
-webkit-transform: translateY (0);
}

100% {
Width: 24px;
Height: 24px;
Opacity: 0.1;
-webkit-transform: translateY (-21px);
}
}

@ -moz-keyframes loader {
0%
Width: 10px;
Height: 10px;
Opacity: 0.9;
-moz-transform: translateY (0);
}

100% {
Width: 24px;
Height: 24px;
Opacity: 0.1;
-moz-transform: translateY (-21px);
}
}

DIV indicating the spinner in the index ()

Edit button (JavaScript)

$ & # 39; table & # 39 ;.[data-modal]& # 39 ;, function (s) {
openmodal (this.href);
return false;
});

Function Openmodal (URL) {
// Request a request and load the form in the modal window
$ (& # 39; # contentModal & # 39;). load (URL, function () {
$ (& # 39; # modalGeneric & # 39;). modal ({
Keyboard: right
}, & # 39; show & # 39;);

// Enter the submit event
bind Form (this);
});

}

Function bindForm (dialog) {
// Inserts the form with the submit event into the modal window
$ (& # 39; form & # 39 ;, dialog) .submit (function (e, i) {
if ($ (this) .valid () || i) {
// make an ajax request
$ .ajax ({
URL: this.action,
Type: this.method,
Date: $ (this) .serialize (),
Success: Function (Result) {
// If the request is satisfactory, reload the current page
if (result.success) {
window.location = window.location;
} else {
$ (& # 39; # contentModal & # 39;). html (result);
bindForm ();
}
}
});
return false;
} else {
return false;
}
});
}

8 – Modal dialogue no longer works

I have a link to a page that I want to open in a modal dialog. The code for this link is:

This used to work (in Drupal 8.6.4). My topic is a bootstrap subtopic.

Chrome Console Error Log:

Uncught TypeError: The property & # 39; addEventListener & # 39; null can not be read
at expandable_search (main.js? v = 8.6.5: 7)
at main.js & le; v = 8.6.5: 50
at main.js? v = 8.6.5: 51

and

Uncught TypeError: The property & # 39; replace & # 39; from undefined can not be read
with new Drupal.Ajax (ajax.js? v = 8.6.5: 200)
at Object.Drupal.ajax (ajax.js? v = 8.6.5: 115)
in HTMLFormElement. (ajax.js? v = 8.6.5: 148)
at Function.each (jquery.min.js? v = 3.2.1: 2)
at r.fn.init.each (jquery.min.js? v = 3.2.1: 2)
at Function.Drupal.ajax.bindAjaxLinks (ajax.js? v = 8.6.5: 131)
at Object.attach (ajax.js? v = 8.6.5: 28)
at drupal.js? v = 8.6.5: 25
at Array.forEach ()
at Object.Drupal.attachBehaviors (drupal.js? v = 8.6.5: 22)
Drupal.Ajax @ ajax.js? V = 8.6.5: 200
Drupal.ajax @ ajax.js? V = 8.6.5: 115
(anonymous) @ ajax.js? v = 8.6.5: 148
every @ jquery.min.js? v = 3.2.1: 2
every @ jquery.min.js? v = 3.2.1: 2
Drupal.ajax.bindAjaxLinks @ ajax.js? V = 8.6.5: 131
attach @ ajax.js? v = 8.6.5: 28
(anonymous) @drupal.js? v = 8.6.5: 25
Drupal.attachBehaviors @ drupal.js? V = 8.6.5: 22
(anonymous) @ drupal.init.js? v = 8.6.5: 16
t @ready.min.js? v = 1.0.8: 4
setTimeout (async)
Drupal.throwError @ drupal.js? V = 8.6.5: 12
(anonymous) @drupal.js? v = 8.6.5: 27
Drupal.attachBehaviors @ drupal.js? V = 8.6.5: 22
(anonymous) @ drupal.init.js? v = 8.6.5: 16
t @ready.min.js? v = 1.0.8: 4