June 4, 201214 yr Hi guys, So i got this problem with my form. It's a simple form for subscribing to a part of my website. Basically the form consists of 2 input fields, one is 'Name' and the other is 'Email Address' and the submit button is an image. The problem I have is at the bottom of my form I have two options: <label><input type="radio" name="subscription_status" value="radio" id="subscription_status_0")>Subscribe</label> (This selection is for users to Subscribe to the service) and next i have: <label><input type="radio" name="subscription_status" value="radio" id="subscription_status_1")>Subscribe</label> (This selection is for users to Unsubscribe to the service) What i want to do is if the user selects the "Subscribe" option and then his submit I want a message to popup saying something like "Thank you for subscribing". However if the user selects the "Unsubscribe" option and then hits submit I want a message to popup saying something like "Your subscription has been canceled". At the moment I can only work out how to get one message to popup when you hit the submit button. I need to understand how i can display the right message for the right selection. I hope someone can help us out on this one, I'm really new to java script so please go easy on me! Many thanks.
June 5, 201214 yr Author At the moment I just a have simple alert message because i not sure how to write the code for the 2nd option (An unsubscribe message). On the form I have: onClick="MM_popupMsg('Thank you for subscribing!')" and in the head i have this simple code: <script type="text/javascript">function MM_popupMsg(msg) { alert(msg);}</script> But as you can see this code is kind of useless because if the user checks the other option (unsubscribe) and submits the form, on click they get the message "Thank you for subscribing!". I hope this makes sense, thank you for your interest.
June 5, 201214 yr Author Sorry just noticed a slight error on my first post, i meant to say this: <label><input type="radio" name="subscription_status" value="radio" id="subscription_status_0")>Subscribe</label> (This selection is for users to Subscribe to the service) and next i have: <label><input type="radio" name="subscription_status" value="radio" id="subscription_status_1")>Unsubscribe</label> (This selection is for users to Unsubscribe to the service)
Create an account or sign in to comment