Forums / Templates, Stylesheets, Page Layout / Prepend Customer Details Company Name

Prepend Customer Details Company Name

Locked

Views: 870

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
4 May 2009, 3:17 AM
#1
david2376 avatar

david2376

New Zenner

Join Date:
May 2009
Posts:
2
Plugin Contributions:
0

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!

4 May 2009, 11:47 AM
#2
rstevenson avatar

rstevenson

Totally Zenned

Join Date:
Nov 2006
Location:
Dartmouth, NS Canada
Posts:
2,400
Plugin Contributions:
0

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

Breakfast: the most important donut of the day.