Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8339197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:49:14+00:00 2026-06-09T04:49:14+00:00

I have this contact form which also relates to a few other tables with

  • 0

I have this contact form which also relates to a few other tables with a HABTM relationship. They are displayed in the form either as a list or as checkboxes. What I want is to be able to search through them while still in the form to select those that are applicable to the contact I am adding with the form. I’m not sure how to do this- was thinking maybe Javascript?

An example of what I am talking about is like Facebook when you’re searching through your friends list.

Below are the HABTM relationships for the Contact Model:

    public $hasAndBelongsToMany = array(
    'Company' => array(
        'className' => 'Company',
        'joinTable' => 'companies_contacts',
        'foreignKey' => 'contact_id',
        'associationForeignKey' => 'company_id',
        'unique' => 'keepExisting',
        'dependent' => true,
        'conditions' => '',
        'fields' => '',
        'order' => '',
        'limit' => '',
        'offset' => '',
        'finderQuery' => '',
        'deleteQuery' => '',
        'insertQuery' => ''
    ),
    'Event' => array(
        'className' => 'Event',
        'joinTable' => 'contacts_events',
        'foreignKey' => 'contact_id',
        'associationForeignKey' => 'event_id',
        'unique' => 'keepExisting',
        'dependent' => true,
        'conditions' => '',
        'fields' => '',
        'order' => '',
        'limit' => '',
        'offset' => '',
        'finderQuery' => '',
        'deleteQuery' => '',
        'insertQuery' => ''
    ),
    'Screenoccupation' => array(
        'className' => 'Screenoccupation',
        'joinTable' => 'contacts_screenoccupations',
        'foreignKey' => 'contact_id',
        'associationForeignKey' => 'screenoccupation_id',
        'unique' => 'keepExisting',
        'dependent' => true,
        'conditions' => '',
        'fields' => '',
        'order' => '',
        'limit' => '',
        'offset' => '',
        'finderQuery' => '',
        'deleteQuery' => '',
        'insertQuery' => ''
    ),
    'Tapearchive' => array(
        'className' => 'Tapearchive',
        'joinTable' => 'contacts_tapearchives',
        'foreignKey' => 'contact_id',
        'associationForeignKey' => 'tapearchive_id',
        'unique' => 'keepExisting',
        'dependent' => true,
        'conditions' => '',
        'fields' => '',
        'order' => '',
        'limit' => '',
        'offset' => '',
        'finderQuery' => '',
        'deleteQuery' => '',
        'insertQuery' => ''
    ),
    'Relation' => array(
        'className' => 'Contact',
        'joinTable' => 'contacts_contacts',
        'foreignKey' => 'contact_id',
        'associationForeignKey' => 'related_id',
        'unique' => true,
        'conditions' => '',
        'fields' => '',
        'order' => '',
        'limit' => '',
        'offset' => '',
        'finderQuery' => '',
        'deleteQuery' => '',
        'insertQuery' => ''
    )
);

Not sure what other codes I need to show you guys, so please do let me know what codes are needed and I will add them to this question.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T04:49:15+00:00Added an answer on June 9, 2026 at 4:49 am

    You could use a jquery plugin to do the job for you.

    It seems that this one corresponds to your criteria. Chosen is nice too.

    Anyway, do a google search to see all the jquery plugin available, and see if one fits your need.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What I have is a form which shows company information and also multiple contact
I have this form: <form> <div class=box> <h1>Contact form :</h1> <label> <span>Typ: </span> <input
i have made a simple php contact form following this tutorial: http://www.catswhocode.com/blog/how-to-create-a-built-in-contact-form-for-your-wordpress-theme The big
I have a textarea form which takes a large block of text. In this
I have a contact form, the values of which I'm passing to a php
I have a contact form on my website, which actually works :D The problem
I have created a contact form which will email me once sent. Now I
On my client's website (domain.com) we have a contact form which sends an email
I have a contact form which posts to mailchimp - but in certain cases,
I have a website, and in the Contact section I have a form which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.