[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 760
  • Last Modified:

Passing ID Number to jQuery Model Popup

I have the attached code, i need to be able to pass a jQuery modal page a dynamic ID number, can anyone help?

The link that fires the jQuery popup is: <a class='EditLineItem' href="#" id="85" title="1">xxxxxxx</a>

The jQuery is:

        $('.EditLineItem').click(function (e) {
            URL = 'edit_line_item.asp?QuoteID=<% =intQuoteID %>&&rnd=' + new Date().getTime();
            $('<div></div>').load(URL).modal(); // AJAX
            return false;
        });


I need the popup to go to this page:
edit_line_item.asp?QuoteID=<% =intQuoteID %>&LineID=XX

where the XX is the ID number on the link





<!--INCLUDE SECURITY INFO HERE-->


<html>
<head>
    <title>Point Of Sale Screen</title>
    <meta http-equiv="Content-Language" content="en-gb">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <meta http-equiv="Refresh" content="600">
    <link href="/admin/epos/stylesheet/till.css" rel="stylesheet" type="text/css">

<!--jQuery Framework-->
	<script src="http://cdn.jquerytools.org/1.2.5/full/jquery.tools.min.js"></script>

<!-- Load jQuery, SimpleModal and Basic JS files -->
<script type='text/javascript' src='/admin/epos/common/jquery/modal/jquery.simplemodal.js'></script>

<script type='text/javascript'>
    jQuery(function ($) {
        var URL;
        // Load dialog on click
        $('#basic-modal .basic').click(function (e) {
            URL = 'tender.asp?QuoteID=78&rnd=' + new Date().getTime();
            $('<div></div>').load(URL).modal(); // AJAX
            return false;
        });
        $('.EditLineItem').click(function (e) {
            URL = 'edit_line_item.asp?QuoteID=78&&rnd=' + new Date().getTime();
            $('<div></div>').load(URL).modal(); // AJAX
            return false;
        });
        $('#somebutton').click(function (e) {
            URL = '...';
            $("#tender").close();
            $('<div id="account"></div>').load(URL).modal(); // AJAX
        });

    });
</script> 

<script language="JavaScript" type="text/javascript">
<!--
    function letter(x) {
        document.softkeyboard.txtCustomerName.value += x;
    }
//-->
</script>

</head>

<body style="overflow: hidden">
    <!--MAIN OUTER BORDER-->
    <table style="border: 0; width: 1020px; height: 765px">
        <tr>
            <td>
                <!--TABLE TO DIVIDE PAGE INTO TWO COLUMNS-->
                <table style="width: 100%; border: 0px solid black;" cellpadding="10px">
                    <tr style="height: 45px; width: 100%; border: 0px solid black;">
                        <td colspan="2" style="width: 100%; vertical-align: middle; border: 0px solid black;">
                            POS - Future Fitness - 27/10/2011 22:42:39
                        </td>
                    </tr>
                    <tr style="height: 720px; width: 100%;">
                        <td style="width: 50%; vertical-align: top; border: 0px solid black;">
                            

                            <!--VIRTUAL RECIEPT HERE-->
                            
                            <table style="width: 100%; border: 4px solid #444; background-color: #FFFFFF; height: 450px; color: #000;" cellpadding="5">
                                <tr style="height: 20px;">
                                    <td style="border-bottom: 1px solid #000000; width: 21px;">&nbsp;</td>
                                    <td style="border-bottom: 1px solid #000000; width: 250px;">Item/Product</td>
                                    <td style="border-bottom: 1px solid #000000; width: 50px; text-align: center;">Qty</td>
                                    <td style="border-bottom: 1px solid #000000; width: 75px;">Price</td>
                                    <td style="border-bottom: 1px solid #000000; width: 75px;">Total</td>
                                </tr>
                                <tr style="height: 400px;">
                                    <td colspan="5" style="vertical-align: top;">
                                        <table style="width: 100%; color: #000;">
                                            
                                            <tr>
                                                <td style="border-bottom: 1px solid #CCCCCC; font-family: Courier; width: 21px; vertical-align: middle;"><a href="/admin/epos/processing/new_sale/process_delete_sale_item.asp?QuoteID=78&QuoteLineID=85"><img style="border: 0;" src="/images/common/icons/ico_cross.gif"></a></td>
                                                <td style="border-bottom: 1px solid #CCCCCC; font-family: Courier; width: 250px; vertical-align: top;"><a class='EditLineItem' href="#" id="85" title="1">Garnell Anabolic Mass II Chocolate</a>&nbsp;</td>
                                                <td style="border-bottom: 1px solid #CCCCCC; font-family: Courier; width: 50px; vertical-align: top; text-align: center;">1&nbsp;</td>
                                                <td style="border-bottom: 1px solid #CCCCCC; font-family: Courier; width: 75px; vertical-align: top;">£50.00&nbsp;</td>
                                                <td style="border-bottom: 1px solid #CCCCCC; font-family: Courier; width: 75px; vertical-align: top;">£50.00&nbsp;</td>
                                            </tr>
                                            
                                        </table>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="text-align: right;" colspan="5"><span class="total">Total: £50.00</span></td>
                                </tr>
                            </table>
                            
                            <table style="width: 100%; border: 0px;" cellpadding="5">
                                <tr>
                                    <td><input type="image" src="/admin/epos/images/buttons/btn_cancel.png" value="Transaction Cancel" name="TransactionCancel" onclick='location="/admin/epos/processing/transaction_cancel/transaction_cancel.asp?QuoteID=78";'></td>
                                    <td style="text-align: right;">
                                        <div id='basic-modal'>
                                            <input type='image' src="/admin/epos/images/buttons/btn_tender.png" name='basic' value='Tender' class='basic'/>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td style="width: 50%; vertical-align: top; border: 0px solid black;">
                        
<table style="width: 100%; border: 4px solid #444; background-color: #FFFFFF;" cellspacing="3" cellpadding="2">
    <tr style="background-color: ##444; width: 100%;">
        <td colspan="4"><span class="HomeScreenHeader">Select Department</span></td>
    </tr>
    
        <tr>
            
            <td class="ProductListing" style="background-color: #;">
                
                            <a href="/admin/epos/till.asp?QuoteID=78&DepartmentID=11"><img width="75" border="0" alt="Memberships" src="/images/department_images/awaiting_image_th.gif"></a>
                        <br />
                <a class="ProductListing" href="/admin/epos/till.asp?QuoteID=78&DepartmentID=11">Memberships</a>
            </td>
            
            <td class="ProductListing" style="background-color: #;">
                
                            <a href="/admin/epos/till.asp?QuoteID=78&DepartmentID=10"><img width="75" border="0" alt="test" src="/images/department_images/awaiting_image_th.gif"></a>
                        <br />
                <a class="ProductListing" href="/admin/epos/till.asp?QuoteID=78&DepartmentID=10">test</a>
            </td>
            
            <td class="ProductListing" style="background-color: #;">
                
                            <a href="/admin/epos/till.asp?QuoteID=78&DepartmentID=1"><img width="75" border="0" alt="Fridge" src="/images/department_images/fridge.jpg"></a>
                        <br />
                <a class="ProductListing" href="/admin/epos/till.asp?QuoteID=78&DepartmentID=1">Fridge</a>
            </td>
            
            <td class="ProductListing" style="background-color: #;">
                
                            <a href="/admin/epos/till.asp?QuoteID=78&DepartmentID=2"><img width="75" border="0" alt="Single Servings" src="/images/department_images/awaiting_image_th.gif"></a>
                        <br />
                <a class="ProductListing" href="/admin/epos/till.asp?QuoteID=78&DepartmentID=2">Single Servings</a>
            </td>
            
        </tr>
        
        <tr>
            
            <td class="ProductListing" style="background-color: #;">
                
                            <a href="/admin/epos/till.asp?QuoteID=78&DepartmentID=3"><img width="75" border="0" alt="Bars" src="/images/department_images/bars.jpg"></a>
                        <br />
                <a class="ProductListing" href="/admin/epos/till.asp?QuoteID=78&DepartmentID=3">Bars</a>
            </td>
            
            <td class="ProductListing" style="background-color: #;">
                
                            <a href="/admin/epos/till.asp?QuoteID=78&DepartmentID=4"><img width="75" border="0" alt="Buckets & Bags" src="/images/department_images/buckets.jpg"></a>
                        <br />
                <a class="ProductListing" href="/admin/epos/till.asp?QuoteID=78&DepartmentID=4">Buckets & Bags</a>
            </td>
            
            <td class="ProductListing" style="background-color: #;">
                
                            <a href="/admin/epos/till.asp?QuoteID=78&DepartmentID=5"><img width="75" border="0" alt="Protein Tubs & Sachets" src="/images/department_images/protein.jpg"></a>
                        <br />
                <a class="ProductListing" href="/admin/epos/till.asp?QuoteID=78&DepartmentID=5">Protein Tubs & Sachets</a>
            </td>
            
            <td class="ProductListing" style="background-color: #;">
                
                            <a href="/admin/epos/till.asp?QuoteID=78&DepartmentID=6"><img width="75" border="0" alt="Pre & Post Workouts" src="/images/department_images/pre-post-workout.jpg"></a>
                        <br />
                <a class="ProductListing" href="/admin/epos/till.asp?QuoteID=78&DepartmentID=6">Pre & Post Workouts</a>
            </td>
            
        </tr>
        
        <tr>
            
            <td class="ProductListing" style="background-color: #;">
                
                            <a href="/admin/epos/till.asp?QuoteID=78&DepartmentID=7"><img width="75" border="0" alt="Capsules, Creatine & Aminos" src="/images/department_images/creatine.jpg"></a>
                        <br />
                <a class="ProductListing" href="/admin/epos/till.asp?QuoteID=78&DepartmentID=7">Capsules, Creatine & Aminos</a>
            </td>
            
            <td class="ProductListing" style="background-color: #;">
                
                            <a href="/admin/epos/till.asp?QuoteID=78&DepartmentID=8"><img width="75" border="0" alt="Accessories" src="/images/department_images/awaiting_image_th.gif"></a>
                        <br />
                <a class="ProductListing" href="/admin/epos/till.asp?QuoteID=78&DepartmentID=8">Accessories</a>
            </td>
            
            <td class="ProductListing" style="background-color: # <font face="Arial" size=2>
<p>ADODB.Field</font> <font face="Arial" size=2>error '80020009'</font>
<p>
<font face="Arial" size=2>Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.</font>
<p>
<font face="Arial" size=2>/admin/epos/till.asp</font><font face="Arial" size=2>, line 0</font>

Open in new window

0
net-workx
Asked:
net-workx
1 Solution
 
amit_gCommented:
Change

URL = 'edit_line_item.asp?QuoteID=78&&rnd=' + new Date().getTime();

to

URL = 'edit_line_item.asp?QuoteID=' + $(this).attr("id") + '&&rnd=' + new Date().getTime();
0
 
net-workxAuthor Commented:
Final Code:

URL = 'edit_line_item.asp?QuoteID=<% =intQuoteID %>&QuoteLineID=' + $(this).attr("id") + '&&rnd=' + new Date().getTime();
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now