php - Convert jQuery option value to a non-object -
I am trying to pass the var text of an option into a jquery loading event but the code text is not returning Is the option value, I believe it is returning an object in return. How do I get string values to select an option? Here the code is still here
var statevar = $ ("# stateselect option: selected"). Val (); $ ("#stateselect"). Change (function () {console.log ($ ("#stateselect option: selected"). Val ()); $ ("#FactoryPricing") .load ("/ include / StateSelection Php" + "? StateSELECT =" + Statewide);}); }); php variable statetel = Returning empty while trying to call that variable
Try it:
console.log ($ ("# state option: selected"). Text ()); Example & lt; Option value = "3" selected = "selected" & gt; Three & lt; / Option & gt; $ ("...... option: selected"). Text (); // Return "three" $ (this) .val (); // Return "3" UPDATE You can find it:
$ ( "#FactoryPricing") .load ("/ include / StateSelection.php" + "? StateSELECT =" + this.value); Like : () statewide = this.value; $ ("#FactoryPricing") .load ("/ include / StateSelection.php" + "? StateSELECT =" + statevar);});});
Comments
Post a Comment