Hi I have modal that has a form and after submitting it has a dismissal message.
How can I fade it after closing and clearing all the fields?
Here is my javascript
$('.modal').on('hidden.bs.modal', function(){
$(this).find('form')[0].reset();
});
Thank you so much
Related
I have a form in which two modals are there, one inside another. after submitting the second modal, page refreshes and exits from first modal and loads the parent page. What I want to achieve is that, if I submit the second modal, it submits the value and reload to first modal not to parent page. Any suggestions will be very much helpful
I have used the event.preventDefault(); function but its not working
When I call the modalController.dismiss() method like this :
dismiss() {
this.modalController.dismiss(); }
When I press on the back button : image here
, the modal closed itself correctly image here ,but the tabs disappear when I am redirect to the previous page (before present the modal). instead of displaying the tabs like here.
Any idea to fix this ?
Thank you for your response.
Cordially, Will.
My website home page uses parallax. I have a button in my home page which opens a modal when clicked. The problem is if I scroll over the modal to see overflown modal body content, the background i.e html body starts scrolling. Clicking or hovering over the modal doesn't make any difference. But when I disable parallax modal works perfectly.
How can I achieve default modal functionality thereby keeping parallax feature also ?
I am trying to use dynamic content inside my modal using angular controller model.
My codepen: codepen.io/anon/pen/dpJxa1
I am trying to increment $scope.count whenever user clicks Create contact button inside the modal. This count will be used to populate first name in the modal.
Even though the count is increasing which is shown in alert, it is not reflecting the modal. How can I listen for the changes in my model and show it in modal.
Thanks in advance.
Call the .show() method on your modal again, after each time you want the modal to update content. So add something like $scope.myModal.show(); to your increment function.
I have to import some XML data into my app.
Now I open a UIActionSheet and add as a subview a UIActivityIndicatorView. Initially I show a progress wheel and a button with 'Cancel'.
When the XML has been imported, I want to hide the progress wheel (this it's easy) and change the button into a 'Done' button, all in the same UIActionSheet.
What I'm doing now is closing the UIActionSheet with the option dismissWithClickedButtonIndex, but I don't like this way because it's the same as pressing 'Cancel', and then I show an UIAlertView displaying "All data has been imported".
Is this possible ?
You shouldn't be doing that, when it loads correctly just dismiss the ActionSheet. On the other hand if an error occurs then display an alert.
Think about the user who will use the app multiple times a day, a Done message each time will be a waste of time.
UPDATE
As i understand your goal is to use the ActionSheet just as a popup (with Cancel ability), if so, just call dismissWithClickedButtonIndex:animated: when your XML loading is done.
If its successful then just call the dismiss method, if its unsuccessful then call the dismiss and popup an alert
This is a bit of a hack but should work. Note that there is a good chance that this will result in your app not being accepted into the app store as you're messing around with the action sheet in ways Apple didn't intend.
Initially display the action sheet with both the 'Done' and 'Cancel' buttons. Before displaying the sheet hide the 'Done' button using its hidden property. To see how to access the 'Done' button see this question.
Then when you're hiding the UIActivityIndicatorView, also change the hidden property of both the 'Cancel' and 'Done' buttons, so that the 'Done' button becomes visible. If the 'Done' button appears in the wrong position move it by modifying its centre property.