Bonjour,
Merci de vos réponses.
En gros voici une partie du calcul
Dans la partie <head> :
1 2 3
| function calcul3(){
var loyertotal2 = Number(loyernormal * surface*12);
document.getElementById("loyertotal2").value = loyertotal2.toFixed(0); |
Dans la partie html, une partie du formulaire calculatrice :
1 2 3
| <input name="surface" type="text" id="surface" />
<input name="loyernormal" type="text" id="surface" />
<input type="button" onClick="calcul3()" value="Calculer" class="myButton3"> |
Toujours dans la partie html, là où j'affiche les résultats :
<input name="loyertotal2" type="text" id="loyertotal2" readonly/>
Jusque là tout va bien, sauf que je voudrais récupérer ce résultat afficher une barre jquery :
Dans ma partie head :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| <script type="text/javascript" charset="utf-8">
$(document).ready(function() {
// Custom markup
var ratingconfig = {
animate: true,
duration: 1000,
ease: "easeOutBounce",
maxRating: 10,
wrapperWidth: 120,
showText: true,
wrapperClass: "wrapper_books",
innerClass: "inner_books",
textClass: "rating_books"
}
$('.book_rating').ratingbar(ratingconfig);
// Dynamically update the rating if the value changes
$("#bumper").click(function() {
var randomrating1=Math.floor(Math.random()*11)
$("#book1 ." + ratingconfig.textClass).text(randomrating1);
var randomrating2=Math.floor(Math.random()*11)
$("#book2 ." + ratingconfig.textClass).text(randomrating2);
$('.book_rating').ratingbar('update', ratingconfig);
});
});
</script> |
Dans ma partie HTML :
<td id="book1" class="book_rating">//Là je devrais récupérer la donnée</td>
Si je marque une valeur à la main dans cette balise td, tout va bien. Mais je n'arrive ni à afficher la donnée brute sans <input>...
Je viens d'essayer de passer par $("#test").text('X'); mais ça ne fonctionne pas...
Partager