Advertisement

08.19.2008 at 02:24AM PDT, ID: 23658899
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.0

Profile update form returns user to index.cfm but it shouldnt

Asked by bede123 in Cold Fusion Markup Language, Hypertext Markup Language (HTML), ColdFusion Application Server

Tags:

Hi Experts,

i'm using a coldfusion cms. i've slightly customised the profile update page and it works fine (it does the update) but on submit the user is returned to the main index.cfm page instead of being returned to the original page where a message should be displayed confirming the update has taken place.

here is the page: (allot of the markup in this page is beyond my level so all help appriciated)Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
<cfsilent>
<cfif not isdefined('request.userBean')>
<cfset request.userBean=application.userManager.read(listFirst(getAuthUser(),"^")) />
 
<cfif structKeyExists(request,"first_name")>
	<cfset request.fname=form.first_name>
</cfif>
 
<cfif structKeyExists(request,"last_name")>
	<cfset request.lname=form.last_name>
</cfif>
 
<cfif structKeyExists(request,"payer_email")>
	<cfset request.username=form.payer_email>
</cfif>
 
<cfif structKeyExists(request,"payer_email")>
	<cfset request.email=form.payer_email>
</cfif>
 
 
 
<cfset request.userBean.set(request)>
</cfif>
<cfparam name="msg" default="Account Information (*Required)">
<cfparam name="request.categoryID" default="">
</cfsilent>
 
<cfoutput>
 
<h2><cfif getAuthUser() eq ''>Create Profile<cfelse>
Edit Profile for #listGetAt(getAuthUser(),2,'^')#</cfif></h2>
<div id="svEditProfile">
<cfif not(structIsEmpty(request.userBean.getErrors()) and request.doaction eq 'createprofile')>
 
<cfif not structIsEmpty(request.userBean.getErrors()) >
 <div id="editProfileMsg" class="required">#application.utility.displayErrors(request.userBean.getErrors())#</div>
<cfelse>
  <div id="editProfileMsg" class="required">#msg#</div>
</cfif>
	<!--- <a id="editSubscriptions" href="##">Edit Email Subscriptions</a> --->
	<form name="profile" id="profile" action="#application.configBean.getIndexFile()#?nocache=1" method="post" onsubmit="return validate(this);"  enctype="multipart/form-data">
	<fieldset>
	<legend>Contact Information</legend>
	<ul>
	<li>
	<label for="firstName">First Name<span class="required">*</span></label>
	<input type="text" id="firstName" class="text" name="fname" value=" #HTMLEditFormat(request.userBean.getfname())#" required="true" message="The 'First Name' field is required." maxlength="50"/>
	</li>
	<li>
	<label for="lastName">Last Name<span class="required">*</span></label>
	<input type="text" id="lastName" class="text" name="lname" value="#HTMLEditFormat(request.userBean.getlname())#" required="true" message="The 'Last Name' field is required." maxlength="50"/>
	</li>
	<li>
	<label for="usernametxt">Username<span class="required">*</span></label>
	<input name="username" id="usernametxt" type="text" value="#HTMLEditFormat(request.userBean.getusername())#" class="text"  required="yes" message="The 'Username' field is required." maxlength="50">
	</li>	
	
	<!---<li>
	<label for="companytxt">Organization</label>
	<input name="company" id="companytxt" type="text" value="" class="text" maxlength="50"/>
	</li>--->
 
       
<cfif getAuthUser() eq ''>
	<li>
	<label for="emailtxt">Email<span class="required">*</span></label>
	<input name="email" id="emailtxt" validate="email" type="text" value="#HTMLEditFormat(request.userBean.getemail())#" class="text"  required="true" message="The 'Email' field must be in a valid email format." maxlength="50">
	</li>
	<li>
	<label for="email2xt">Email Confirm<span class="required">*</span></label>
	<input name="email2" id="email2txt" type="text" value="" class="text" validate="match" matchfield="email" required="true" message="The 'Email' and 'Email Confirm' fields must match." maxlength="50">
	<li>
	<label for="passwordtxt">Password<span class="required">*</span></label>
	<input name="passwordNoCache" validate="match" matchfield="password2" type="password" value="" class="text"  message="The 'Password' and 'Password Confirm' fields must match." maxlength="50">
	</li>
	<li>
	<label for="password2txt">Password Confirm<span class="required">*</span></label>
	<input  name="password2" id="password2txt" type="password" value="" required="true" class="text"  message="The 'Password Confirm' field is required." maxlength="50">
	</li>
<cfelse>
 	 <li>
	<label for="emailtxt">Email<span class="required">*</span></label>
	<input name="email" id="emailtxt" validate="email" type="text" value="#htmlEditFormat(request.userBean.getEmail())#" class="text"  required="true" message="The 'Email' field must be in a valid email format." maxlength="50">
	</li>
 
	<li>
	<label for="passwordtxt">Password</label>
	<input name="passwordNoCache" validate="match" matchfield="password2" type="password" value="" class="text"  message="The 'Password' and 'Password Confirm' fields must match." maxlength="50">
	</li>
	<li>
	<label for="password2txt">Password Confirm</label>
	<input  name="password2" id="password2txt" type="password" value="" required="false" class="text"  message="The 'Password Confirm' field is required." maxlength="50">
	</li>
 
</cfif>
 
</ul>
</fieldset>
 
<!---
<fieldset>
	<legend>Upload Your Photo</legend>
		<ul class="columns2">
			<li class="col">
				<p class="inputNote">Photo must be JPG format optimized for up to 150 pixels wide.</p>
					<input type="file" name="newFile" validate="regex" regex="(.+)(\.)(jpg|JPG)" message="Your logo must be a .JPG" value=""/>
			</li>
			<li class="col">
				<cfif len(request.userBean.getPhotoFileID())>
							<img src="#application.configBean.getContext()#/tasks/render/small/?fileid=#request.userBean.getPhotoFileID()#" alt="your photo" />
			<input type="checkbox" name="removePhotoFile" value="true"> Remove current logo 
			</cfif>
			</li>
		</ul>
</fieldset>
--->
 
<!--- extended attributes as defined in the class extendtion manager --->
<cfsilent>
<cfset extendSets=application.classExtensionManager.getSubTypeByName(request.userBean.gettype(),request.userBean.getsubtype(),request.siteid).getExtendSets(true) />
</cfsilent>
<cfif arrayLen(extendSets)>
<cfloop from="1" to="#arrayLen(extendSets)#" index="s">	
	<cfset extendSetBean=extendSets[s]/>
	<fieldset>
	<legend>#extendSetBean.getName()#</legend>
		<input name="extendSetID" type="hidden" value="#extendSetBean.getExtendSetID()#"/>
		<cfsilent>
		<cfset attributesArray=extendSetBean.getAttributes() />
		</cfsilent>
		<ul>
		<cfloop from="1" to="#arrayLen(attributesArray)#" index="a">	
		<cfset attributeBean=attributesArray[a]/>
		<cfset attributeValue=request.userBean.getExtendedAttribute(attributeBean.getAttributeID(),true)/>
			<li>
				<cfif not listFind("TextArea,MultiSelectBox",attributeBean.getType())>
					<label for="ext#attributeBean.getAttributeID()#"><cfif attributeBean.getRequired()><b>*</b></cfif>#attributeBean.getLabel()#<!--- <cfif len(attributeBean.gethint())><br/>#attributeBean.gethint()#</cfif> ---></label>
				<cfelse>
					<label for="ext#attributeBean.getAttributeID()#"><cfif attributeBean.getRequired()><b>*</b></cfif>#attributeBean.getLabel()#<cfif len(attributeBean.gethint())><br/>#attributeBean.gethint()#</cfif></label>
				</cfif>
		
			<cfif attributeBean.getType() neq 'TextArea'>		
				#attributeBean.render(attributeValue,true)#
				<cfif attributeBean.getType() neq "MultiSelectBox" and len(attributeBean.gethint())>
					<div class="inputBox rightCol" >
						<p class="fieldDescription">#attributeBean.gethint()#</p>
					</div>	
				</cfif>
				<cfif attributeBean.getType() eq "File" and len(attributeValue) and attributeValue neq 'useSavaDefault'>
					<div class="inputBox rightCol">
						<a href="#application.configBean.getContext()#/tasks/render/file/?fileID=#attributeValue#" target="_blank">[Download]</a> 
						<br/><input type="checkbox" name="extDelete#attributeBean.getAttributeID()#" value="true"/> 
						delete
					</div>
				</cfif>
			<cfelse>
			#attributeBean.render(attributeValue)#
			</cfif>	
			</li>
		</cfloop>
		</ul>
	</fieldset>
</cfloop>
</cfif>
 
<cfif getAuthUser() neq ''>
	<input name="submit" type="submit"  value="Update Profile" />
	<input type="hidden" name="userid" value="#listgetat(getAuthUser(),1,'^')#"/>
	<input type="hidden" name="doaction" value="updateprofile">
<cfelse>
	<input type="hidden" name="userid" value=""/>
	<input type="hidden" name="isPublic" value="1"/>
	<input type="hidden" name="inactive" value="0"/>
	<input name="submit" type="submit"  value="Create Profile"/>
	<input type="hidden" name="doaction" value="createprofile">
    <input type="hidden" name="groupid" value="F81EB252-1999-1A0D-62E94FB0B65504CB"/>
    
 
</cfif> 
 
<input type="hidden" name="siteid" value="#request.siteid#" />
<input type="hidden" name="returnURL" value="#request.returnURL#" />
<input type="hidden" name="display" value="editprofile">
 
 
</form>
</div>
 <script type="text/javascript">
<!--  
document.getElementById("profile").elements[0].focus();
-->
</script>
<cfelse>
<!--- This is where the script for a newly created account does if inactive is default to 1 for new accounts--->
<div id="editProfileMsg" class="required">Thank you for registering a new account. <br/>Your login information has been emailed to you.</div>
</cfif>
</cfoutput>
 
 
[+][-]08.20.2008 at 06:36PM PDT, ID: 22275527

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Cold Fusion Markup Language, Hypertext Markup Language (HTML), ColdFusion Application Server
Tags: Coldfusion
Sign Up Now!
Solution Provided By: BSSupport
Participating Experts: 1
Solution Grade: B
 
 
[+][-]08.22.2008 at 11:03AM PDT, ID: 22292536

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628