Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Submit to reveal? Simple form that carries over content…

  • This topic is empty.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #204034
    misterdix
    Participant

    So. I’d like to have a simple 4 question form. A user enters 4 values into said form. When they hit submit, it keeps those values and shows what the ‘best practice’ values would be next to it, with more content below.

    So it’s like a comparison form see…

    Is this easy java action? Also I’m a really crappy coder that would definitely need some guidance.

    #204040
    Podders
    Participant

    Hi @misterdix

    What code do you have in place already? Can you create a pen to show what the issue is you’re having?

    #204043
    nkrisc
    Participant

    There’s probably 100 ways you could accomplish that. You’ll need to be more specific and ideally share what code you’ve got so far.

    #204064
    misterdix
    Participant

    At this point i’m starting with a blank canvas. I’m trying to figure out if it’s something I can do with relative ease or not. I don’t generally code from zero, but tend towards manipulating existing code and bending it to my will, albeit poorly.

    So, with that, I humbly ask for a potential solution to my need for a ‘reveal’ here in the forum. I live in Vermont and can happily reward someone with crazy good beer. :)

    So to be more specific…

    it basically would look like:

    text blurb – four questions with space for the browser to enter values. and when they hit submit, those values stay and the information is revealed. the information is the same regardless of the values that is input, so the input areas are ‘stupid’ as it were and there is no deeper logic to it than that. is that helpful?

    #204069
    Paulie_D
    Member

    I’m confused as to what it is you expect the output to be.

    Without some kind of database being interrogated I don’t see this working… And even if you had such a database it would, presumably, be your opinion of what “best practice” actually is, especially since that it is an entirely subjective thing.

    Basically, I am not sure what it is you are trying to achieve.

    #204070
    misterdix
    Participant

    I’m really just looking for the simplest solution. I don’t even think a dB is necessary because it’s just carrying over 4 ‘answers’ to what would be a second page of information.

    I have no need to even capture the answers in any meaningful sense, just for them to appear on the next page along with more info.

    #204071
    misterdix
    Participant

    a little browsing stumbled me to here:
    https://stackoverflow.com/questions/23260966/is-html5-localstorage-appropriate-to-store-input-field-values

    is localstorage a potential cure to my concept? could i use it to ‘hold’ the four values and display them again on a second page?

    #204076
    nkrisc
    Participant

    If you don’t need to save the date except to show it on the next page you could pass it to the next page with a query string and then reading it from the URL on the next page with some JS.

    Or you could use a cookie.

    Or you could use local storage.

    Or it could all be on the same page and just template it with JS.

    Or…

    #204135
    Alan C
    Participant

    Or modify the URL to carry the data over! A bit archaic but super simple =D

Viewing 9 posts - 1 through 9 (of 9 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.