Re: Xara Designer Pro X / Text Entry Field?
I'm pretty sure you're going to be needing a database to be able to store and reference the data, the input field would then be linked to the database. My mind keeps flicking to CRM software, but that's wandering off into different territory entirely.
Re: Xara Designer Pro X / Text Entry Field?
Looking at what James has said brings up the question of how many references are there likely to be? I ran down the track of hundreds because the example you gave had 3 figure digits, but of course, that may not be the case.
Re: Xara Designer Pro X / Text Entry Field?
Yes there are many ways to approach this, even if the page naming was simplified it could drastically reduce the code.
If for example each page was named page-this-page.htm then the code could simply be reduced to
PHP Code:
<php?
if(isset($_GET['page']) {
$page = $_GET['page'];
header('Location: page-{$page}.htm');
}
?>
for an infinite number of static pages.
1 Attachment(s)
Re: Xara Designer Pro X / Text Entry Field?
Quote:
Originally Posted by
BerndR
I Need a TextBox where someone type in a number...
Not a DropDown List or something else...
Only a TextBox as Input Field and then go forward with the Number to a Fix Link...
See the first note....
BerndR, I may have missed the essence of your request but I think you are asking for something like: Attachment 123404.
I have not checked for any page that might not exist. If the input is not a number or outside the range of 100 to 999, the jump goes to the index page.
Acorn
Re: Xara Designer Pro X / Text Entry Field?
Acorn - Good solution.
Is there any way to make this so an Enter will also process the number as well as the OK button? I think this is a common expectation.
Re: Xara Designer Pro X / Text Entry Field?
Quote:
Originally Posted by
gwpriester
Acorn - Good solution.
Is there any way to make this so an Enter will also process the number as well as the OK button? I think this is a common expectation.
Yes, there probably is, but I didn't want to design a solution that wasn't for the problem.
My quick go is:
Code:
<input id="jumptopage" type="number" min="100" placeholder="Type in a 3-digit number">
<button id="btnGo" onclick="goJump()">OK</button>
<script>
var pageinput = document.getElementById("jumptopage");
pageinput.addEventListener("keyup", function(event) {
if (event.keyCode === 13) {
event.preventDefault();
document.getElementById("btnGo").click();
}
});
function goJump() {
var page = pageinput.value;
if (page > 99 && page < 1000) {
location.href = page + ".htm";
}
else {
location.href = "index.htm";
}
}
</script>
Use this code in the Placeholder Body.
It gets quite tricky, especially adding bits for older browsers.
Acorn
Re: Xara Designer Pro X / Text Entry Field?
Quote:
If the input is not a number or outside the range of 100 to 999, the jump goes to the index page.
That doesn't work for me Acorn, I just get a 404 Page not found ???
I prefer the Enter option than the click OK one ;)
Re: Xara Designer Pro X / Text Entry Field?
Quote:
Originally Posted by
Egg Bramhill
That doesn't work for me Acorn, I just get a 404 Page not found ???
I prefer the Enter option than the click OK one ;)
Egg, I only "created" an index, 123 & 234 set of pages. If you type in any other 3-digit number it will go to that URL, which, as yet, doesn't exist.
You need to consider screen readers and having both is better usability.
Acorn
Re: Xara Designer Pro X / Text Entry Field?
My misunderstanding Acorn, outside of the range of 100 to 999 ;)
Re: Xara Designer Pro X / Text Entry Field?
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 :-)