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