I can not say because of what is happening, but I can suggest a way
how to deal with
declare global variable:
var cnt = 0;

$("select:#stock").change(function()
               {
               var stock = $("select#stock").val();
               if (cnt == 0){
                  cnt = 1;
                 $.get("implement/stock_mysql.php", {'stockID':
stock}, function(sw)
                         {
                         var pages = $("select#S_page_count").val();
                         var SW_total = (sw * pages);
                         alert( 'SW_total = ' + SW_total);
                         $("#Spine1").text(SW_total);
                         $("#Spine2").text(SW_total);
                         });
                 }else{
                   cnt = 0;
                 }
               });

   Gk___




2009/10/20 rftemp <rft...@iinet.net.au>:
>
> Hi Peoples,
> Would appreciate some help with this one, have a nice little muliform
> page
> which is all working well but i need some of the html selects to call
> back to jquery (working)
> then the the jquery to call the php (working) then the php to call the
> mysql ( not working at the moment)
> then the whole lot to return the mysql data to the jquery to be used
> in a formula. The problem i am having is
> every time i select an option i add to the number of responses i get
> ie select once 1 callback select something
> else get 2 callbacks, i only want one callback per response!
> here is the jquery :
>        $("select:#stock").change(function()
>                {
>                var stock = $("select#stock").val();
>                $.get("implement/stock_mysql.php", {'stockID': stock}, 
> function(sw)
>                        {
>                        var pages = $("select#S_page_count").val();
>                        var SW_total = (sw * pages);
>                        alert( 'SW_total = ' + SW_total);
>                        $("#Spine1").text(SW_total);
>                        $("#Spine2").text(SW_total);
>                        });
>                });
> thanks in advance
> rftemp
>

Reply via email to