1 Attachment(s)
Re: Xara Designer Pro X / Text Entry Field?
Quote:
Originally Posted by
BerndR
First, I do not get an input field placed?
When I do the preview, I see the field only as a text field and not as an input field.
Great that I want to help so many !!!
Thank you in advance :-)
BerndR, here is an updated design file - Attachment 123441.
You need to Preview it with Preview website (F5) so all three pages are rendered.
The black box contains all the code. All you have to do is add pages 100 through 999 as the Page filename.
Acorn
Re: Xara Designer Pro X / Text Entry Field?
Hi!
The first is now running :-)
But Now i Need a Input field wich a decimal Input...
It will nor be running!?!?!
__________________________________________________ _______________
<input style="height:45px;width:230px;font-size: 1rem;font-family:Verdana;background:#FFECECEC;border-radius:8px; text-align:center;" id="jumptopagebodymass"; type="number"; pattern="[0-9]+([,\.][0-9]+)?; min="1,0"; step="0,1"; lang="de" ; placeholder="Ihr persönlicher Wert";" wi>
<div <br> <br> </div>
<button style="height:55px;width:235px;font-size: 1rem;font-family:Verdana;transform: scale(0.99);border-radius:8px;background:#a6a6a6;color:#FFFAFA;" id="btnGobodymass" onclick="goJumpbodymass()">Auswerten</button>
<script>
var pageinput = document.getElementById("jumptopagebodymass");
pageinput.addEventListener("keyup", function(event) {
if (event.keyCode === 13) {
event.preventDefault();
document.getElementById("btnGobodymass").click();
}
});
function goJumpbodymass() {
var page = jumptopagebodymass.value;
if (page > 1,0 && page < 100,0)
{
if (page < 18,5) {
location.href = "body-mass-1.htm";
} else if (page > 24,9 && page < 30,0) {
location.href = "body-mass-2.htm";
} else if (page > 29,9 && page < 35,0) {
location.href = "body-mass-3.htm";
} else if (page > 34,9 && page < 40,0) {
location.href = "body-mass-4.htm";
} else if (page > 39,9) {
location.href = "body-mass-5.htm";
} else {
location.href = "body-mass-index.htm";
}
}
else {
location.href = "index.htm";
}
}
</script>
__________________________________________________ _______________
Where is the bug?
Best Regards
Bernd
Re: Xara Designer Pro X / Text Entry Field?
Input Example: "18" / "30,5" / "45,2" / "15,5"…. then jump to the Right page….
Re: Xara Designer Pro X / Text Entry Field?
You would need to use a (.) Instead of a (,)
Re: Xara Designer Pro X / Text Entry Field?
but I need as input a ","
Can I do this in a "." convert?
var page = jumptopagebodymass.value.replace… is not working…?
Re: Xara Designer Pro X / Text Entry Field?
I would look for an existing German BMI from and copy that across.
Javascript used a ',' as the decimal point.
Try, page = page .replace(/,/g, '.');
Then set all the number ranges in you if then elseif statements to decimal dots.
Acorn
Re: Xara Designer Pro X / Text Entry Field?
this will not working?
__________________________________________________ __
<input style="height:45px;width:230px;font-size: 1rem;font-family:Verdana;background:#FFECECEC;border-radius:8px; text-align:center;" id="jumptopagebodymass"; type="number"; placeholder="Ihr persönlicher Wert";" wi>
<div <br> <br> </div>
<button style="height:55px;width:235px;font-size: 1rem;font-family:Verdana;transform: scale(0.99);border-radius:8px;background:#a6a6a6;color:#FFFAFA;" id="btnGobodymass" onclick="goJumpbodymass()">Auswerten</button>
<script>
var pageinput = document.getElementById("jumptopagebodymass");
pageinput.addEventListener("keyup", function(event) {
if (event.keyCode === 13) {
event.preventDefault();
document.getElementById("btnGobodymass").click();
}
});
function goJumpbodymass() {
var page = jumptopagebodymass.value;
page .replace(/,/g, '.');
if (page > 1.0 && page < 100.0)
{
if (page < 18.5) {
location.href = "body-mass-1.htm";
} else if (page > 24.9 && page < 30.0) {
location.href = "body-mass-2.htm";
} else if (page > 29.9 && page < 35.0) {
location.href = "body-mass-3.htm";
} else if (page > 34.9 && page < 40.0) {
location.href = "body-mass-4.htm";
} else if (page > 39.9) {
location.href = "body-mass-5.htm";
} else {
location.href = "body-mass-index.htm";
}
}
else {
location.href = "index.htm";
}
}
</script>
__________________________________________________
Re: Xara Designer Pro X / Text Entry Field?
You entered "page .replace(/,/g, '.');" it has to be
Quote:
page = page.replace(/,/g, '.');
TG added the space!
Acorn
Re: Xara Designer Pro X / Text Entry Field?
Sorry, your Right ;-)
Many Thanks for the Hint :-))))))
Re: Xara Designer Pro X / Text Entry Field?
Now a i have a litte problem with a radio button :-(
__________________________________________________ ____________________
<div id="MyGeschlecht">
<input type="radio"; id="rbmaenlich"; checked; style="height:15px; width:30px; name="Geschlecht";>
<label style="font-size: 1rem; fontWeight = 'bold'; font-family:Verdana;background:#FFECECEC;border-radius:8px;" ; for="rbmaenlich"> männlich</label>
</input>
<input type="radio"; id="rbweiblich"; style="height:15px; width:30px; name="Geschlecht";>
<label style="font-size: 1rem; fontWeight = 'bold'; font-family:Verdana;background:#FFECECEC;border-radius:8px;"; for="rbweiblich"> weiblich</label>
</input>
</div>
__________________________________________________ ___________________
On this code a can click on both radio button... but why?
Normal only one radio button can by active...