Ok,
So I have custom fields in my user registration. I have declared them in the snippet call and have the input tags named the same as the DB fields. Do I need to declare that I’m using the web_user_attributes_extended or is that default? The values are not being stored in the table. Do the DB fields need to match the order of the decalred fields in the snippet call? Is there any simple example of how to use custom fields (for now only text fields) and get them into a table? I’ve searched but it seems like everyone got past these steps quicker than I
Here’s the call:
[!WebLoginPE? &type=`register` &customTable=`modx_web_user_attributes_extended` &customFields=`dogdob,dogbreed,dogname,dogshots,dogvet,dogvetphone` ®isterTpl=`regTpl` &liHomeId=`15` &groups=`Clients` !]
Here’s my registration chunk:
<div id="wlpeNewUser">
<form id="wlpeUserRegisterForm" action="[~[*id*]~]" method="POST" enctype="multipart/form-data">
<fieldset id="wlpeUserRegisterInput">
<div id="wlpeNewUserInfo">
<p id="wlpeRegisterInfo">Use this form to register for a new user account.<br />
<span class="info">Filds marked with <span class="required">*</span> are required.</span>
</p>
</div>
<legend>Register for a new user account</legend>
<label for="wlpeUserRegisterEmail"><span class="required">*</span> Email
<input id="wlpeUserRegisterEmail" type="text" name="email" value="[+post.email+]" />
</label>
<label for="wlpeUserRegisterUserName" style="display:none;"><span class="required">*</span> Desired User Name
<input id="wlpeUserRegisterUserName" type="hidden" name="username" value="[+post.username+]" />
</label>
<label for="wlpeUserRegisterFullName"><span class="required">*</span> Full Name
<input id="wlpeUserRegisterFullName" type="text" name="fullname" value="[+post.fullname+]" />
</label>
<label for="wlpeUserRegisterPassword"><span class="required">*</span> Password
<input id="wlpeUserRegisterPassword" type="password" name="password" value="[+post.password+]" />
</label>
<label for="wlpeUserRegisterPasswordConfirm"><span class="required">*</span> Password (confirm)
<input id="wlpeUserRegisterPasswordConfirm" type="password" name="password.confirm" value="[+post.password.confirm+]" />
</label>
<label for="wlpeUserRegisterPhone"><span class="required">*</span>Phone number
<input id="wlpeUserRegisterPhone" type="text" name="phone" value="[+post.phone+]" />
</label>
<label for="wlpeUserRegisterDogName"><span class="required">*</span>Dog's Name
<input id="wlpeUserRegisterDogName" type="text" name="dogname" value="[+post.dogname+]" />
</label>
<label for="wlpeUserRegisterDogDOB">Dogs Birthday
<input id="wlpeUserRegisterDogDOB" type="text" name="dogdob" value="[+post.dogdob+]" />
</label>
<label for="wlpeUserRegisterDogBreed"><span class="required">*</span>Breed of Dog
<input id="wlpeUserRegisterDogBreed" type="text" name="dogbreed" value="[post.dogbree+]" />
</label>
<label for="wlpeUserRegisterDogVet"><span class="required">*</span>Name of Vet
<input id="wlpeUserRegisterDogVet" type="text" name="dogvet" value="[+post.dogvet+]" />
</label>
<label for="wlpeUserRegisterDogVetPhone"><span class="required">*</span>Phone of Vet
<input id="wlpeUserRegisterDogVetPhone" type="text" name="dogvetphone" value="[+post.dogvetphone+]" />
</label>
<label for="wlpeUserRegisterDogShots"><span class="required">*</span>Is your dog current on vaccinations? (Yes/No)
<input id="wlpeUserRegisterDogShots" type="text" name="dogshots" value="[+post.dogshots+]" />
</label>
<img id="wlpeUserDefaultImage" src="[+user.defaultphoto+]" alt="Default User Image" title="Default User Image" height="100" width="100" />
<label for="wlpeUserProfilePhoto" id="photolabel">Dog Photo
<input id="wlpeUserProfilePhoto" type="file" name="photo" />
</label>
<p id="wlpeUserProfilePhotoInfo" class="info">No bigger than 1MB. Photo may take a few minutes to process, all pics will be resized to 100 x 100.</p>
<label for="wlpeUserRegisterComment">Special Instructions (anything our groomers may need to know about your dog and their personality or any medical conditions known).
<textarea id="wlpeUserRegisterComment" name="comment">[+post.comment+]</textarea>
</label>
<p id="wlpeTermsOfServiceLabel">Terms of Service/Privacy Policy</p>
<div id="wlpeTermsOfService">[+tos+]</div>
<label for="wlpeTosCheckbox" id="wlpeTosCheckboxLabel"><span class="required">*</span>I accept the Terms of Service
<input type="checkbox" id="wlpeTosCheckbox" name="tos" />
</label>
</fieldset>
<fieldset id="wlpeUserRegisterButtons">
<button type="submit" id="wlpeSaveRegisterButton" name="service" value="register">Register</button>
<button type="submit" id="wlpeCancelRegisterButton" name="service" value="cancel">Cancel</button>
</fieldset>
</form>
</div>
Once a user registers how do you access the user information? I posted earlier about how to use placeholders, I can use the standard MODx place holders but once I login using a web user account I can’t figure or find out how to pull up profile info....it’s been a couple weeks since I touched this and feel like I just took a giant leap backwards! As always any insight is much appreciated.
UPDATE: I renamed my custom fields and re-uploaded the template file which seemed to have reset things. One thing I also did was remove the DIV wrapper on my chunk I think that might have been conflicting and throwing an error. According to Chromes JS window I had a ton of extra span tags in there. Needless to say after tinkering around the custom fields are saving data.