jquery mobile: 2 popups/dialogs opened simultaneously - jquery-mobile

this question is similar to the common question about 'chaining' jqm popups (FYI ... answer is: use a settimeout to call 2nd popup).
However, I am looking for a solution to have 2 popups open at the same time.
Specifically, I have popup that shows a user's shopping cart items. Each item has an X-button to allow the user to remove/delete the item. But the X-button (delete action) needs to issue a confirm-delete dialog (popup). Thus the shopping cart popup would be open, and on top of it would be the confirm-delete popup/dialog.

Related

Submit Paypal via URL instead of HTML opens new tabs

The problem: "Add to Cart" hyperlink opens a new browser tab for each click rather than consolidating into a single one.
The ideal solution: When the "Add to Cart" hyperlinks are clicked, they will populate the checkout screen in a single tab only.
I use a published google sheet to list some items for sale in a list. Each item has an adjacent hyperlink labeled "Add to Cart" that has its own unique Paypal URL to pass inputs (I have pasted example below). This works fine and all however if the user clicks another Add to Cart then it opens up yet another tab. This doesnt seem like a big deal but it is a bad user experience confuses them all the time and leads to checkout issues. With HTML this is not a problem but I can't use HTML.
So my question is, is it possible to use a google script to open all the Add to Carts URLs in a single tab? Or any way to auto-close the first tab in favor of the next one? Or any way to even open in SAME tab such as mimick target="_self" but in URL format? Or any other way to do this?
(such as: https://www.paypal.com/cgi-bin/webscr?cmd=_cart&business=bob123%40gmail%2ecom&lc=US&item_name=TOYTRACTOR&item_number=123456789&amount=999%2e00&currency_code=USD&button_subtype=products&no_note=0&cn=Add%20special%20instructions%20to%20the%20seller%3a&no_shipping=2&shipping=10%2e00&add=1&bn=PP%2dShopCartBF%3abtn_cart_LG%2egif%3aNonHosted)
Unfortunately, that's the experience with PayPal Standard cart buttons. I would recommend you switch to building your own cart experience, and then you can use the cart upload method to build a PayPal Standard request.
Alternatively, you could move to the Express Checkout APIs, which gives you more features and functionality.

Is this the right MVC Application Structure

Requirements:
1.A page showing list of id's from the database.
2.Once the user clicked the item ID in the list, a modal will pop up showing all details from that id
Problem:
MVC seems to required another URL in order to use the selected id that cause redirection from another page showing the id details
Solution:
so what i did is put the list into a partial view and call the partialview in another page pretending that it didn't redirects.
Question:
Am I doing it the right way or a dirty way?
Do MVC behave this way?
If you have any suggestions please let me know.
this is not the mvc issue, if you want to popup a modal window to show the detail information, there are many ways can do that, this is the javascript issue, you can use jquery dialog or sweet alert2 or others js lib for that.

Ruby on Rails: Page Redirect Issue

I am having trouble with a page redirect issue in a small multi-step form process within a Rails application. Here's the rundown,
1.) There are 3 pages to this form with a, "save" and "next", button at the bottom of each page.
2.) If a user has filled out new information on the page, and attempts to click the next button, a warning modal popups and prompts the user to save their changes, or discard. This is where my issue is occurring.
3.) Instead of directing the user to the next page as they intended after pressing the modal save button, it instead just refreshes the same page the user is currently on.
I've tried everything, but honestly am not very experienced with Rails. I have made a collection on codepen for you to see all of the files.
Rails Files
Quick breakdown of the three files you will see.
1.) The saveModal is the popup that prompts for save or discard.
2.) Skills is just one of the 3 pages in the form. Any important info for you here would be at the top and bottom of the document I assume.
3.) The controller code where I think the redirect is happening is also there.

passing variable to jQuery from same Class

I have googled for 2days so far :) Not finding the right answer yet. So expert help is needed.
I am writing the webpage, where I use php and mysql. On the webpage, it display list of products. Next to each product there is a button called "Compare". When user press the button, it should pop up the dialog box and ask user to enter some info then user click submit or cancel in the dialog box. When user click submit in the dialog box, it should take user to another page, where he will be displayed with information he is looking for (hopefully)....
For dialog box I am using jQuery-ui dialog box. The challenge I am facing is when user click on "Compare" button, I need to pass the product information to dialog box. Because all the product info are extracted from mysql and loop with php to display, they all have same class. eg
product 1Compare
product 2Compare
So how do i know which product_info i need to pass? I thought of adding attribute to button and product info with number to distinguish which one is selected, then i need to have multiple multiple dialog function attached to each button.
Any thought will be much appriciated.
Thanks
Create a global variable to store the index.
When we click on any button, we will check it's index and store in it.
After opening the popup or just before showing the popup, access this index. Using this index, access the division in which the product contains. Get required details from there. Update data in dialog box. Show dialog box.
Also clear global variable when you close the dialog box.
You can get more information about index here : http://api.jquery.com/index/
Friends, please suggest better solutions if any.
Thanks.

update multiple dropdown menus at the same time

I'm still very new to rails so forgive me if this question just doesn't make any sense. However, I have a requirement to update several dropdown boxes in a report (which has one dropdown per row) at the same time. So, instead of clicking each dropdown in each row and selecting the status, what the user would like to do is press a button (or some other action) that changes all rows to a particular status. This functionality would be similar to selecting several checkboxes next to unread emails in gmail and hitting the "mark as read" button.
Any and all help appreciated.
This should help get you started:
http://railscasts.com/episodes/165-edit-multiple
http://railscasts.com/episodes/52-update-through-checkboxes

Resources