Results 1 to 2 of 2
  1. #1
    Join Date
    May 2009
    Posts
    2
    Plugin Contributions
    0

    Default Prepend Customer Details Company Name

    Our online store is used for franchise locations to purchase products for their business, all users have the same company name followed by a unique location code. I am trying to find a way that when a user registers an account they will just need to enter their location code in the company name field. Once they submit the form the company name/store code will automatically add the company name to the front. For example: "XYZ Company {{company_name}}".

    Is their an easy way to accomplish this? Any help would be greatly appreciated!

  2. #2
    Join Date
    Nov 2006
    Location
    Dartmouth, NS Canada
    Posts
    2,378
    Plugin Contributions
    0

    Default Re: Prepend Customer Details Company Name

    It's a fairly simple thing to use javascript to pre-populate a field in a form with some text. You use the onlad call to do that. And not surprisingly, Zen Cart has a ready made way to help you do that. See the file docs/read_me_onload.html for where to place your js code within the Zen Cart file structure. You can find lots of sample code on-line for populating fields using js, incuding ways to make the blinking cursor appear right after your ready-to-go text, if you want to.

    Or, as you suggest, you could do the processing after they submit the form. But I like the above way better -- and you can always post-process to make sure they didn't edit the company name.

    Rob

 

 

Similar Threads

  1. v154 Company Name after Customer Name Support
    By dw08gm in forum All Other Contributions/Addons
    Replies: 8
    Last Post: 24 Aug 2015, 07:08 AM
  2. v151 Company Name after Customer Name (instead of before)
    By dw08gm in forum General Questions
    Replies: 3
    Last Post: 8 Oct 2014, 11:42 AM
  3. Company name vs Customer name at registration
    By sanji in forum Managing Customers and Orders
    Replies: 4
    Last Post: 28 Jan 2008, 10:57 AM
  4. Company Name on customer sign up
    By bjraines in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 27 Nov 2006, 07:40 PM
  5. Customer/Company Name Length
    By seanscully in forum Managing Customers and Orders
    Replies: 1
    Last Post: 10 Aug 2006, 09:43 AM

Posting Permissions

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