php - Geo My WP - Create Dropdown Menu Search Input -
i have learned lot forum , in need of specific help. if can me solve this, have eternal gratitude.
framework: wordpress site has buddypress(bp) , geo wp installed. each user has set of bp profile fields geo wp uses search through , return results.
goal: on geo wp search form, wish have dropdown list user can select 1 item; example "hockey". selected item used search through 2 (2) different bp xprofile fields (eg: "main sports" & "casual sports"). these 2 bp xprofile fields populated admin , both text line single terms separated comma; example "basketball, football, soccer, hockey" etc. if user selected term matches term in either of 2 bp xprofile fields, geo wp return bp profile in search results.
problem: can't figure out how this. if both bp xprofile fields selected search through in geo wp settings, both show on search form. need 1 input in search field.
i have run out of ideas on manipulating code , appreciate fresh eyes on problem.
many thanks,
mm.
you might try doing js changes form. not perfect, worked @ least in case. here's example of mean.
jquery('#gmw-address-1').remove(); jquery('#gmw-address-field-wrapper-1').prepend('*');
in case
you'd need bind 2 events: documentready
, change
select create.
on documentready
- get values selects want join together
- replace selects hiden fields
- create select combining 2 you've replaced
on change
- check chosen value
- match plausible values determine witch select belongs to
- update hidden field matched in pt. 2 value pt.1
Comments
Post a Comment