SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Thread: How would I...

  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2012
    Posts
    56
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    How would I...

    Hey everyone,

    Just wondering if someone can help. I have a slight problem and have come up with a solution on paper, now I just need to transfer it into something that actually works!

    What I want is to make a program or HTML page which does the following;

    Contains a text-box and when a user types in a specific fault code, they are given information on how to clear the code. I have thought of just using Microsoft Excel, but I have about 100 different codes and would prefer it if I had something like "Please enter your problem code below" rather than a drop down box where users have to sift though to find the necessary code.

    I know I could probably do this using if/when statements, but I want something that looks nice and is very intuitive to use,

    Any help would be much appreciated,

    Cheers

  2. #2
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,895
    Mentioned
    212 Post(s)
    Tagged
    12 Thread(s)
    I would use an HTML form, with a text input field for the user to enter their error code.
    You could add some sort of "auto suggest" functionality, which would have the form make suggestions as they type (bit like Google).
    You could then either display the end result when the user submits the form, or you when encounter an exact match.
    This could all be done in JavaScript and PHP

  3. #3
    SitePoint Enthusiast
    Join Date
    Nov 2012
    Posts
    56
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the fast reply Pullo!

    Could you advise the best way to find the information to do this with JavaScript? Is there a specific thing this is called to help me locate the resources to learn? I have a fairy decent grasp of HTML and CSS to create and layout the page, just lack the important part of adding the functionality aspect!

    Thanks

  4. #4
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,895
    Mentioned
    212 Post(s)
    Tagged
    12 Thread(s)
    No probs

    I would probably use jQuery to do this, especially if you are not overly familiar with JavaScript.

    One possibility would be to use the jQuery UI autocomplete plugin
    This allows you to hard-code your error message codes into your JS file and might work quite well for a comparatively small amount of data.

    If you want a bit more flexibility, you could try storing your error codes in a database and fetcing them via PHP / AJAX.
    Here's a bit more info on that: http://www.htmlblog.us/jquery-autocomplete

    This seems like it might be a fun project, so let me know if you have any questions.

  5. #5
    SitePoint Enthusiast
    Join Date
    Nov 2012
    Posts
    56
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Cheers Pullo

    I love the idea of the auto-complete, that would make the task for the end user alot less painful.

    I'll give an example of what I want the page to display as I'm shocking at trying to explain things...

    If a user encounters an error code, I want to direct them to a webpage which would contain a text box,

    They then enter a code, for example H5-01

    Once they press submit, they are taken to a webpage which would have instructions on how to clear and resolve the code.

    I was just going to list a table of error codes and there resolutions, but this isnt fun enough

    Thanks again

  6. #6
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,895
    Mentioned
    212 Post(s)
    Tagged
    12 Thread(s)
    That sounds cool.
    But what might be even cooler, is to fetch the instructions for how to clear and resolve the code dynamically and insert them into the page using AJAX.
    This would however, speak for the database method, as then you could store everything in one place.

  7. #7
    SitePoint Enthusiast
    Join Date
    Nov 2012
    Posts
    56
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I better get leaning PHP and all about databases...this hobby just gets more in depth every day.

    I finally thought I was getting somewhere after three months, but looks like I havent even scratched the surface!

    Thanks for the help and I'll report back with the finished product (probably sometime in 2014 )


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
  •