Welcome to TalkGraphics.com
Results 1 to 10 of 34

Hybrid View

  1. #1
    Join Date
    Aug 2000
    Location
    Placitas, New Mexico, USA
    Posts
    41,518

    Default 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.

  2. #2
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,882

    Info Re: Xara Designer Pro X / Text Entry Field?

    Quote Originally Posted by gwpriester View Post
    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
    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

  3. #3
    Join Date
    Aug 2000
    Location
    Harwich, Essex, England
    Posts
    21,934

    Default Re: Xara Designer Pro X / Text Entry Field?

    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
    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

  4. #4
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,882

    Default Re: Xara Designer Pro X / Text Entry Field?

    Quote Originally Posted by Egg Bramhill View Post
    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
    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

  5. #5
    Join Date
    Aug 2000
    Location
    Harwich, Essex, England
    Posts
    21,934

    Default Re: Xara Designer Pro X / Text Entry Field?

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •