Ahoj
Viete mi pomoct ohladom pridania JS do PHP.... robim si multiselect a nefungujem JS v PHP a kod vyzera takto :
<?php
echo"<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
<head><link rel=\"stylesheet\" type=\"text/css\" rel="nofollow" href=\"multi_css.css\"></head> ";
echo"<section class=\"container\">
<div>
<select id=\"leftValues\" size=\"5\" multiple></select>
</div>
<div>
<input type=\"button\" id=\"btnLeft\" value=\"<<\" />
<input type=\"button\" id=\"btnRight\" value=\">>\" />
</div>
<div>
<select id=\"rightValues\" size=\"4\" multiple>
<option>1</option>
<option>2</option>
<option>3</option>
</select>
<div>
<input type=\"text\" id=\"txtRight\" />
</div>
</div>
</section></body>";
echo"$(\"#btnLeft\").click(function () {
var selectedItem = $(\"#rightValues option:selected\");
$(\"#leftValues\").append(selectedItem);
});
$(\"#btnRight\").click(function () {
var selectedItem = $(\"#leftValues option:selected\");
$(\"#rightValues\").append(selectedItem);
});
$(\"#rightValues\").change(function () {
var selectedItem = $(\"#rightValues option:selected\");
$(\"#txtRight\").val(selectedItem.text());
});";
?>
Vsetko robim v PHP subore a potrebujem aby ten JS isiel. Dakujem za odpovede