Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #8410 > unrolled thread

jquery $.post 2 values

Started by"Jesolo Sun" <gala@tiscali.it>
First post2011-11-18 22:12 +0100
Last post2011-11-19 08:29 +0100
Articles 4 — 3 participants

Back to article view | Back to comp.lang.javascript


Contents

  jquery $.post 2 values "Jesolo Sun" <gala@tiscali.it> - 2011-11-18 22:12 +0100
    Re: jquery $.post 2 values Denis McMahon <denismfmcmahon@gmail.com> - 2011-11-18 22:56 +0000
    Re: jquery $.post 2 values "S.T." <anon@anon.com> - 2011-11-18 16:15 -0800
      Re: jquery $.post 2 values "Jesolo Sun" <gala@tiscali.it> - 2011-11-19 08:29 +0100

#8410 — jquery $.post 2 values

From"Jesolo Sun" <gala@tiscali.it>
Date2011-11-18 22:12 +0100
Subjectjquery $.post 2 values
Message-ID<4ec6ca33$0$1385$4fafbaef@reader2.news.tin.it>
$("select#stampa").change(function(){
     var stampa = $("select#stampa option:selected").attr('value');
     var quantita = $("input#quantita").attr('value');
     $.post("select.php", {PrinttypeID:stampa}, function(data){
     });
});


I need to sent in the file  select.php 2 values PrinttypeID:stampa and 
Quantita:quantita

I get values
var stampa = $("select#stampa option:selected").attr('value');
var quantita = $("input#quantita").attr('value');

how send  this 2 values?

[toc] | [next] | [standalone]


#8415

FromDenis McMahon <denismfmcmahon@gmail.com>
Date2011-11-18 22:56 +0000
Message-ID<4ec6e29b$0$28631$a8266bb1@newsreader.readnews.com>
In reply to#8410
On Fri, 18 Nov 2011 22:12:19 +0100, Jesolo Sun wrote:

> how send this 2 values?

Ask in a jquery support forum.

Rgds

Denis McMahon

[toc] | [prev] | [next] | [standalone]


#8419

From"S.T." <anon@anon.com>
Date2011-11-18 16:15 -0800
Message-ID<4ec6f530$0$1735$742ec2ed@news.sonic.net>
In reply to#8410
On 11/18/2011 1:12 PM, Jesolo Sun wrote:
> $("select#stampa").change(function(){
> var stampa = $("select#stampa option:selected").attr('value');
> var quantita = $("input#quantita").attr('value');
> $.post("select.php", {PrinttypeID:stampa}, function(data){
> });
> });
>
>
> I need to sent in the file select.php 2 values PrinttypeID:stampa and
> Quantita:quantita
>
> I get values
> var stampa = $("select#stampa option:selected").attr('value');
> var quantita = $("input#quantita").attr('value');
>
> how send this 2 values?
>
>

$.post("select.php", {PrinttypeID:stampa,Quantita:quantita}, 
function(data){});


[toc] | [prev] | [next] | [standalone]


#8421

From"Jesolo Sun" <gala@tiscali.it>
Date2011-11-19 08:29 +0100
Message-ID<4ec75ac9$0$1388$4fafbaef@reader1.news.tin.it>
In reply to#8419

"S.T."  ha scritto nel messaggio 
news:4ec6f530$0$1735$742ec2ed@news.sonic.net...

On 11/18/2011 1:12 PM, Jesolo Sun wrote:
> $("select#stampa").change(function(){
> var stampa = $("select#stampa option:selected").attr('value');
> var quantita = $("input#quantita").attr('value');
> $.post("select.php", {PrinttypeID:stampa}, function(data){
> });
> });
>
>
> I need to sent in the file select.php 2 values PrinttypeID:stampa and
> Quantita:quantita
>
> I get values
> var stampa = $("select#stampa option:selected").attr('value');
> var quantita = $("input#quantita").attr('value');
>
> how send this 2 values?
>
>

$.post("select.php", {PrinttypeID:stampa,Quantita:quantita},
function(data){});



ok i do this :
var colori = $("select#colori option:selected").attr('value');
var quantita = $("input#quantita").attr('value');
var stampa = $("select#stampa option:selected").attr('value');
$.post("select.php", {ID:colori,PrinttypeID:stampa,Quantita:quantita}, 
function(data){

in the select.php i writed
if(isset($_POST['ID']))
{
    print "ID ".$_POST['ID'] ;
    print "PrinttypeID ".$_POST['PrinttypeID'] ;
    print "Quantita ".$_POST['Quantita'] ;
    die;
}

and write in the browser :
1
\n
2
\n
PrinttypeID 7Quantita 108

If I modify
$.post("select.php", {ID:colori}, function(data){
if(isset($_POST['ID']))
{
    print "ID ".$_POST['ID'] ;
    die;
}
the result is
ID 2
works!!!


Why i have this errors ??


[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web