We need to see something closer to a real-life example. There's a bit too
much missing in the code you posted.

In particular, what does the page look like when it actually has more than
one row from your DB in it? I can't tell which part of your HTML would be
repeated per row. What is the exact HTML structure of a single row in the
page?

I assume you are free to change the generated HTML any you want, is that
right?

Also, I assume the <a> tag that calls click_function is just test code that
won't be in your real page?

About how many rows would typically be listed in a single page?

As it sits, all I can suggest is a few things:

1) You should probably use a jQuery event handler instead of the onclick
handler.

2) Instead of hard coded element IDs in your $.post, you'll need to do a bit
of DOM traversing or some such to get to the element values you need.

3) To make that DOM traversing easier, it's a good idea to wrap each row in
its own container element such as a DIV. Or you may want to use a table to
display the row data (it does sound like tabular data after all). In that
case the table's TR elements would serve that purpose.

-Mike

On Sun, Dec 6, 2009 at 4:36 AM, factoringcompare.com <
firstfacto...@googlemail.com> wrote:

> Hi Guys’
>
> I have hit a complete brick wall on this one.
>
> I have an ASP page that lists out a DB into 3 columns. Each row has a
> unique ID number.  When the user updates a checkbox I would like to
> fire off an AJAX update to my DB.
>
> I have made the page that’s ready to receive the unique ID Number and
> updated my DB but I can’t get the unique ID number to the update page
> using Jquery.
>
> I have the following script working to update a specific record. I
> just can take it to the next level so that it will pick up individual
> ID’s and post them across.
>
> <html>
> <head>
> <title></title>
> <script language="javascript" src="Sitefiles-N/js/
> jquery-1.3.2.min.js"></script>
> <script language="javascript">
> function click_function()
> {
> $.post("Sitefiles-N/jquery.formwizard-0.9.8/QuoteProcessor3.asp",
> {QuoteNo: $("#QuoteNo").val(), accept: $("#accept").val() },
> function(responseText){$("#show_stuff").html(responseText)});
> }
> </script>
> </head>
> <body>
>
> <label>Enter your name:</label> <input name="QuoteNo" type="text"
> id="QuoteNo" value="83" />
> <br /><br />
> <label>accept:</label> <input name="accept" type="text" id="accept"
> value="-1" />
> <br /><br />
> <p><a href="#" onclick="click_function();">click this</a> </p>
> <input type="button" value="click this to make Ajax call"
> onclick="click_function();">
>
> <div id="show_stuff"></div>
>
> </body>
> </html>
>

Reply via email to