User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the HTML and CSS section within the Web Development category of DaniWeb, a massive community of 401,678 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,480 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our HTML and CSS advertiser: Lunarpages Web Hosting
Views: 637 | Replies: 0
Reply
Join Date: Jul 2007
Posts: 13
Reputation: tashakota is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
tashakota tashakota is offline Offline
Newbie Poster

Form submit with weird select box result

  #1  
Apr 15th, 2008
I have what I thought was a basic form with multiple text boxes and one select box. The form submits and info is updated in a database. However, it fails because of the select box. The select box is automatically selected to the user's organization if they have one. The select box submits a value in the form 575,575. (575 is the id of the Organization and the value of the option) If you change the organization it's more like 575,815 (with the 575 being the initial value and the 815 being the new value).

I can't seem to figure this one out. And whenever I get to the point of needing to finally ask about it, it turns out to be something I've missed. However, I can't seem to find any problems with my code.

<cfquery name="listorgs" datasource="members">
	SELECT tblOrganizations.INSTITUT, tblOrganizations.OrganizationID 
	FROM tblOrganizations
	ORDER BY tblOrganizations.INSTITUT;
</cfquery>

<select name="OrgID" style="width:30em;">
	<option value="">None Selected</option>
	<option value="0">Add New Organization</option>
	<cfloop query="listorgs">
		<cfif listorgs.OrganizationID eq SESSION.AMSPerson.OrgID>
			<option value="#listorgs.OrganizationID#" selected>#listorgs.INSTITUT#</option>
		<cfelse>
			<option value="#listorgs.OrganizationID#">#listorgs.INSTITUT#</option>
		</cfif>
	</cfloop>
</select>

ETA: Oh and if I comment out the line of code to update the OrgID, it works just fine.
Last edited by tashakota : Apr 15th, 2008 at 2:24 pm.
AddThis Social Bookmark Button
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb HTML and CSS Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the HTML and CSS Forum

All times are GMT -4. The time now is 7:31 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC