SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 2006
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to concatenate vars for this code

    I have the following code:
    Code:
    Code:
    Event.observe($('store_locator_form'), 'submit', function() {
            $('storelocator-results').style.visibility = 'visible';
            storeLocator.search($('address').value, {
                radius: $('radius').value
            });
        });
    This is for a store locator script. I have it currently running off one field called "address" I need to add fields to the form and change the current address field to "city" and add "state" and "zip"
    How do I concatenate the fields city, state and zip into address? I have to put it all into one because the address is all in one field in the db and address is also being run through a script for googlemaps. I have tried many ways and have been unsuccessful.

    Thanks for any help!

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,717
    Mentioned
    103 Post(s)
    Tagged
    4 Thread(s)
    You can do it by comma separating your CSS selectors
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    SitePoint Enthusiast
    Join Date
    Dec 2006
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    HI,

    Thanks for your response.

    My ids are: city, state, zip
    Do you mean simply:

    (city, state, zip) ?

    Where would I place it?

    Thanks!

  4. #4
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,717
    Mentioned
    103 Post(s)
    Tagged
    4 Thread(s)
    I would need more than just the script before being able to go much further on this.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  5. #5
    SitePoint Enthusiast
    Join Date
    Dec 2006
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Thanks! I appreciate it.


    I have attached the script.
    Attached Files Attached Files


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •