I am trying 2 Role based registration. Ex: Role1, Role2
Once click Registration link then select any Role(role1, role2) after form field automatically change. It’s possible ?
Example:
Select Role : (Role1) or (Role2) Once select role form automatically changed.
Role1 Form
Name:
Email:
Address:
Role2 Form
Company Name:
Phone Number:
Company Address:
Thanks.
jquery for a simple answer:
before the get_header() function
wp_enqueue_script(‘jQuery’);
wp_enqueue_style(‘jquery-style’, ‘http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/smoothness/jquery-ui.css‘);
your selector element:
set your form 2 elements as display none.
Html form:
Jquery (enqueue jquery with wp_enqueue(‘jQuery’); see codex for this. Add the to the page either in the header or footer (escape php) sometimes you need to change position for it to work..)
jsfiddle here: http://jsfiddle.net/dheffernan/MHnfe/
now when you select a role, it hides one form and shows the other.