1
martyras
Breaking down "location" at register form.
  • 2004/12/16 18:51

  • martyras

  • Just popping in

  • Posts: 37

  • Since: 2004/11/1


Hi,

Previously i had included successfully the 'location' field in user registration form. Cause a lot of users don't enter all of their address details I want to split down the 'location' field to let's say these fields:

In registerform.php
$reg_form->addElement(new XoopsFormText(_US_LOCATION_ADDRESS"user_from_address"3060$user_from_address), true);
$reg_form->addElement(new XoopsFormText(_US_LOCATION_TOWN"user_from_town"3060$user_from_town), true);
$reg_form->addElement(new XoopsFormText(_US_LOCATION_ZIP"user_from_zip"3030$user_from_zip), true);


In language/english/user.php I add all the information for _US_LOCATION_ADDRESS etc.

Now in register.php I have added
<input type='hidden' name='user_from_addreess' value='".$myts->makeTboxData4PreviewInForm($user_from_address)."' />
<
input type='hidden' name='user_from_town' value='".$myts->makeTboxData4PreviewInForm($user_from_town)."' />
<
input type='hidden' name='user_from_zip' value='".$myts->makeTboxData4PreviewInForm($user_from_zip)."' />


But in the database, I want all these fields to be entered as one in 'Location' field. Example:

Location: Address, Town, Zip

What & where should i modify in register.php for this to be done? I know it's easy but i can't make it work. I suspect that has something to do with that line:
$newuser->setVar('user_from'$user_from);


Thank you.

2
coopersita
Re: Breaking down "location" at register form.

You just have to change the value of user_from before it is passed to the DB:

$user_from "$user_from_address$user_from_town$user_from_zip";
$newuser->setVar('user_from'$user_from);

3
martyras
Re: Breaking down "location" at register form.
  • 2004/12/16 20:57

  • martyras

  • Just popping in

  • Posts: 37

  • Since: 2004/11/1


was too easy!

Thanks, it worked like charm.

Login

Who's Online

307 user(s) are online (111 user(s) are browsing Support Forums)


Members: 0


Guests: 307


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Oct 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits