check for the reply given by user and provide information accordingly

Discussion in 'HTML & Website Design' started by Karneet, Aug 29, 2013.

  1. #1
    Hello Everyone,

    I am new JavaScript/ HTMLand would like to help my friend with her website. She wants the user to enter the data such as age and marital status. Check for a condition if the age is less than 25 and marital status is single she wants the user to see a specific message. In the same way if the age is more than 25 and status is single some other information. Can anyone please help me with it. Any help would be gratefully accepted.
     
    Karneet, Aug 29, 2013 IP
  2. ApocalypseXL

    ApocalypseXL Notable Member

    Messages:
    6,095
    Likes Received:
    103
    Best Answers:
    5
    Trophy Points:
    240
    #2
    So you want someone to do free design and development for you ?
     
    ApocalypseXL, Aug 29, 2013 IP
  3. khemraj

    khemraj Well-Known Member

    Messages:
    400
    Likes Received:
    13
    Best Answers:
    1
    Trophy Points:
    125
    #3
    same question here :)

    Are you looking for some kind of development services, you can hire me ;)
     
    khemraj, Aug 29, 2013 IP
  4. Karneet

    Karneet Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #4
    Hello Sir,
    Thank you for replying. Let me clarify myself. I do not expect you to do a free design for me. I just want a small piece of code that can get me up and running and from their i will do it myself..
     
    Karneet, Aug 29, 2013 IP
  5. ApocalypseXL

    ApocalypseXL Notable Member

    Messages:
    6,095
    Likes Received:
    103
    Best Answers:
    5
    Trophy Points:
    240
    #5
    So you want someone to do free coding for you. You should know that there is o such thing as a free lunch. Especially when it comes to a for-profit website.
     
    ApocalypseXL, Aug 29, 2013 IP
  6. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #6
    @ApocalypseXL @khemraj
    So, why are you guys here? The purpose of a community forum such as this is to share our knowledge for the benefit of all; for profit site or not does not enter into the equation. If you're here only to drum up business for yourselves, then you're the leeches.

    @Karneet
    It would help to see what you've got so far. Presumably there's a form with some radio buttons: age, <25 or ≥25 and marital status, single or married. Don't forget about the two indeterminate states, m<25 and s≥25.

    There are two ways to go from here, submit the form to the server which uses PHP, e.g., to determine what page to serve back to the user, or as you asked about, use javascript to capture the form with an onsubmit event handler. (Even if you go with javascript, you must have a server-side backup. Not every UA is js aware.) The event handler would compare the input values (name.value) to your criteria to determine which content to insert/show.

    To get more specific, we'd need to see your html at a minimum. In the meantime, Google should provide tutorials, &c. for "attaching javascript onsubmit event handler".

    cheers,

    gary
     
    kk5st, Aug 29, 2013 IP