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

  1. get values selects want join together
  2. replace selects hiden fields
  3. create select combining 2 you've replaced

on change

  1. check chosen value
  2. match plausible values determine witch select belongs to
  3. update hidden field matched in pt. 2 value pt.1

Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

unity3d - Fatal error- Monodevelop-Unity failed to start -