Framework static-plugin; how does it work?
Hello Ray,
I have a parent page that contains a form with a select (select1).
Then I have a static-plugin that contains another select (select2): it loads database results filtered by the select1 value.
That's ok, for now.
But now I need to display a message based on the value of select2.
On regular pages I use simple javascript to read the select value and display the message.
But this doesn't work with static-plugin select.
This is a sample script I use:
<script>
$('#prodotto_reg').change(function () {
$('.sconti').hide();
<?php
$wa_startindex = 0;
while(!$rs_prodotti_tutti->atEnd()) {
$wa_startindex = $rs_prodotti_tutti->Index;
?>
if ($("#prodotto_reg option:selected").val() == '<?php echo($rs_prodotti_tutti->getColumnVal("id_ins")); ?>')
{
$( "#rimborso<?php echo($rs_prodotti_tutti->getColumnVal("rimborso_ins")); ?>" ).addClass("wow bounceIn").css("display","inline-block").show();
}
<?php
$rs_prodotti_tutti->moveNext();
}
$rs_prodotti_tutti->moveFirst(); //return RS to first record
unset($wa_startindex);
unset($wa_repeatcount);
?>
});
</script>
Please note that the #prodotto_reg field is contained in the static-plugin page.
How can I control the static-plugin select value?
Have I to move my logic (script) inside the static-plugin?
Or what?
TIA
tony