Mark Spritzler wrote:Oh, and because of that genius, causes me to spend at least 10 hours to create a hack around their problem.
Mark
Eric Pascarello wrote:
Mark Spritzler wrote:Oh, and because of that genius, causes me to spend at least 10 hours to create a hack around their problem.
Mark
Typing with your toes?
Eric
Bear Bibeault wrote:Well, with jQuery you can use the .val() method on the select element to set the value, but there's no way with just HTML markup.
Mark Spritzler wrote:But how would get reference to the one in the drop down that matches the String value and be able to call .val on it.
and have to loop through them just to compare the strings, then I can set the val(). Definitely a hack in my mind, but if that is the only way.
Mark Spritzler wrote:so calling val(), will set the option to be selected? I thought it just returned whether it was selected or not.
I want to set selected to the option that matches the String. And how am I to pass the String if it is in json.
here is now the line I have
$('#visibility option[value="' + data.visibility = '"]').val();
No hurries, about to leave to go to E3, so will be gone till late, and probably won't get to this for a few days.
I love a good mentalist. And so does this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|