0

I am a jQuery newbie and have searched, but cannot find an answer to my specific situation. Any guidance is appreciated.

I have a Membership Form (#joinPreForm) with four div's signifying the four membership levels: Class-A, Class-B, Class-C, and Class-D. Each membership div contains a glyphicon class (icon-A, icon-B, icon-C, and icon-D, respectively) and an H4 heading ('Class-A', 'Class-B', 'Class-C', and 'Class-D', respectively) by default. Each Membership Level on click, needs to preform these actions:

  1. change form's action attribute to appropriate php (classA.php, ...etc)
  2. removeClass for letter glyphicon: icon-A, ..etc
  3. addClass for checkmark glyphicon 'icon-checkmark'
  4. reset unselected div's to default state: class="icon-A" (respectively); reset form action attribute

Essentially I only want one div to be able to be selected at any given time and all other divs to reset to their unselect, default state.

If no div is selected an error message should show on form submit: "Please select a membership level before proceeding."

I've tried to make this as clear as possible, if not please let me know and I will try to clarify any misunderstanding. Thank you so much.

Joey Kango
  • 13
  • 1
  • 1
  • 4
  • 1
    Very similar questions are posted very often. Post your code to show exactly what you tried and what is currently happening so we can give you better explanations. – phenxd Feb 15 '16 at 14:17
  • I don't know enough about jQuery to even attempt to try to write a script for this process. I find it complicated as a lot is happening. I was hoping for guidance on how I should proceed. – Joey Kango Feb 15 '16 at 14:21
  • http://www.w3schools.com/jquery/jquery_selectors.asp – phenxd Feb 15 '16 at 14:24
  • http://stackoverflow.com/questions/10082031/why-use-jquery-on-instead-of-click – phenxd Feb 15 '16 at 14:25
  • http://stackoverflow.com/questions/11489037/add-and-remove-attribute-with-jquery – phenxd Feb 15 '16 at 14:26
  • Here are a bunch of links that can help you get a kickstart – phenxd Feb 15 '16 at 14:27
  • Thanks for the references, but I'm still confused. I've never written multi function scripts before. – Joey Kango Feb 15 '16 at 14:38
  • Then I suggest you read a few tutorials about javascript. I'm sorry but you're not gonna learn much if we do all the work for you – phenxd Feb 15 '16 at 14:45

0 Answers0