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
le="color: #000000"><?php $reg_form->addElement(new XoopsFormText(_US_LOCATION_ADDRESS, "user_from_address", 30, 60, $user_from_address), true); $reg_form->addElement(new XoopsFormText(_US_LOCATION_TOWN, "user_from_town", 30, 60, $user_from_town), true); $reg_form->addElement(new XoopsFormText(_US_LOCATION_ZIP, "user_from_zip", 30, 30, $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
le="color: #000000"><?php <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:
le="color: #000000"><?php $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:

le="color: #000000"><?php $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

Donat-O-Meter

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

Latest GitHub Commits