BEARBEITEN ICH FAND ES HERAUS. Ich musste nur die jquery hinzufügen und in Joomla tun Sie dies, indem Sie Ihre Vorlage/index.php und fügen diese Zeile von "// Fügen Sie Javascript Frameworks" JHtml::_('jquery.framework');
.jQuery zu Javascript
ARBEITS
ich brauche etwas Hilfe diesen Code zu Javascript konvertieren.
Derzeit funktioniert es nicht in meinem Browser mit jQuery. Ich lade die AJAX-Bibliothek und alles, aber es funktioniert nicht. Ich habe gerade ein Drop-down und div's mit den gleichen IDs hinzugefügt, die ich verwende, um es einfacher zu machen.
Wenn ich das Formular vorschaue, das ich in der Software erstellt habe, die ich verwende, funktioniert es wie beabsichtigt mit diesem jQuery-Code; Sobald ich jedoch die Änderungen im Formular speichere und zur Live-Site gehe, tut es nichts. (Die Software ist RSForm Pro für Joomla .. Ja, ich bin noch neu dazu)
Jede Hilfe ist willkommen.
$(document).ready(function() {
$('#DeliveryPlaces').on('change', function() {
if (this.value == '1') {
$("#LocationDelivery1").show();
$("#LocationDelivery2").hide();
$("#LocationDelivery3").hide();
$("#LocationDelivery4").hide();
$("#LocationDelivery5").hide();
} else if (this.value == '2') {
$("#LocationDelivery1").show();
$("#LocationDelivery2").show();
$("#LocationDelivery3").hide();
$("#LocationDelivery4").hide();
$("#LocationDelivery5").hide();
} else if (this.value == '3') {
$("#LocationDelivery1").show();
$("#LocationDelivery2").show();
$("#LocationDelivery3").show();
$("#LocationDelivery4").hide();
$("#LocationDelivery5").hide();
} else if (this.value == '4') {
$("#LocationDelivery1").show();
$("#LocationDelivery2").show();
$("#LocationDelivery3").show();
$("#LocationDelivery4").show();
$("#LocationDelivery5").hide();
} else if (this.value == '5') {
$("#LocationDelivery1").show();
$("#LocationDelivery2").show();
$("#LocationDelivery3").show();
$("#LocationDelivery4").show();
$("#LocationDelivery5").show();
} else {
$("#LocationDelivery1").hide();
$("#LocationDelivery2").hide();
$("#LocationDelivery3").hide();
$("#LocationDelivery4").hide();
$("#LocationDelivery5").hide();
}
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<select id="DeliveryPlaces">
<option value="-">-</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
<div id="LocationDelivery1">LocationDelivery1</div>
<div id="LocationDelivery2">LocationDelivery2</div>
<div id="LocationDelivery3">LocationDelivery3</div>
<div id="LocationDelivery4">LocationDelivery4</div>
<div id="LocationDelivery5">LocationDelivery5</div>
Dies ist bereits Javascript. :) Schlechte Witze beiseite, hast du etwas versucht? – sinisake
'Dies' ist Javascript, aber Sie beginnen mit Jquery 'Dies' ist gleich $ (This) in jquey –
@sinisake Es ist nicht JavaScript – Maharshi