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.
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.
Gary W. Priester
Mr. Moderator Emeritus Dude, Sir
gwpriester.com | eyetricks-3d-stereograms.com | eyeTricks on Facebook | eyeTricks on YouTube | eyeTricks on Instagram
Yes, there probably is, but I didn't want to design a solution that wasn't for the problem.
My quick go is:
Use this code in the Placeholder Body.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>
It gets quite tricky, especially adding bits for older browsers.
Acorn
Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat
That doesn't work for me Acorn, I just get a 404 Page not found ???If the input is not a number or outside the range of 100 to 999, the jump goes to the index page.
I prefer the Enter option than the click OK one
Egg
Minis Forum UM780XTX AMD Ryzen7 7840HS with AMD Radeon 780M Graphics + 32 GB Ram + MSI Optix Mag321 Curv monitor + 1Tb SSD + 232 GB SSD + 250 GB SSD portable drive + ISP = BT + Web Hosting = TSO Host
Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat
My misunderstanding Acorn, outside of the range of 100 to 999
Egg
Minis Forum UM780XTX AMD Ryzen7 7840HS with AMD Radeon 780M Graphics + 32 GB Ram + MSI Optix Mag321 Curv monitor + 1Tb SSD + 232 GB SSD + 250 GB SSD portable drive + ISP = BT + Web Hosting = TSO Host
Bookmarks