LelloLello
asked on
I would like to display this variable on my page in coldfusion how , #DisplayUsers.new_member_type#
Please take a look on myform.jpg
I have a value retreived a value from a SQL Database via CF Querry.
I would like to display this value on my page, how can i do this .
Is there a way to display it where the radio button is assigned to this value is activated...
<input type="radio" name="intOption" id="intOptionAcademics" value="350" onClick="Calculate_Sub_Tot al()" class="formWidget">
<input type="radio" name="intOption" id="intOption550" value="350" onClick="Calculate_Sub_Tot al()" class="formWidget">
radiobutton-coldfusion.jpg
I have a value retreived a value from a SQL Database via CF Querry.
<li><label for="strBadgeName"><strong>Level Type:</strong></label><cfoutput>#DisplayUsers.new_member_type#<input type="hidden" name="MemberType" value="#DisplayUsers.new_member_type#" size="36"></cfoutput></li>
I would like to display this value on my page, how can i do this .
Is there a way to display it where the radio button is assigned to this value is activated...
<input type="radio" name="intOption" id="intOptionAcademics" value="350" onClick="Calculate_Sub_Tot
<input type="radio" name="intOption" id="intOption550" value="350" onClick="Calculate_Sub_Tot
<fieldset><legend>Registration Information</legend>
<ol class="form">
<li><label class="order" for="intOption1095">A</label>
<input type="radio" name="intOption" id="intOption1095" value="1180" onClick="Calculate_Sub_Total()" class="formWidget">
<span class="details">$1180<!---$1095 ---> *</span></li>
<li><label class="order" for="intOption995">B</label>
<input type="radio" name="intOption" id="intOption995" value="1000" onClick="Calculate_Sub_Total()" class="formWidget">
<span class="details">$1000<!---$995---> *</span></li>
<li><label class="order" for="intOption660">C</label>
<input type="radio" name="intOption" id="intOption660" value="350" onClick="Calculate_Sub_Total()" class="formWidget">
<span class="details">$350<!---$660---></span></li>
<li><label class="order" for="intOptionAcademics">D</label>
<input type="radio" name="intOption" id="intOptionAcademics" value="350" onClick="Calculate_Sub_Total()" class="formWidget">
<span class="details">$350<!---$550---> </span></li>
<li><label class="order" for="intOption550">E</label>
<input type="radio" name="intOption" id="intOption550" value="350" onClick="Calculate_Sub_Total()" class="formWidget">
<span class="details">$350<!---$550---> </span></li>
<li><label class="order" for="intOption1195">F</label>
<input type="radio" name="intOption" id="intOption1195" value="1195" onClick="Calculate_Sub_Total()" class="formWidget">
<span class="details">$1,195 *</span></li>
Thank you very much for your advice!radiobutton-coldfusion.jpg
ASKER
This is my querry.
<cfquery name="DisplayUsers" datasource="Actuaries" username="#application.use rname#" password="#application.pas sword#">
	SELECT * FROM users INNER JOIN
enrollees ON enrollees.enrollee_id_numb er = users.id_number INNER JOIN
meminfotest ON users.id_number = meminfotest.Enrolle_id_num ber
	WHERE (users.user_id = #client.user_id#)
</cfquery>
There is a field in my Table 'enrollees' name of the field is new_member_type
So in my code if i display an cfouput i'm able to view the data in that field which is "FL".
So here is my question.
SINCE it's a FL level, the radio button in my code should 'CHECKED DISABLED' level A on that page.
So changes i should do to my
so my query is working very good.
I have a radio button question with 6 options.
<li><input type="radio" name="intOption" id="intOption1" value="1" onClick="Calculate_Sub_Tot al()" class="formWidget"
<cfif myQuery.somevalue is 1>
checked
</cfif>>
I will attached the code fo your review.
due-cfm.txt
<cfquery name="DisplayUsers" datasource="Actuaries" username="#application.use
	SELECT * FROM users INNER JOIN
enrollees ON enrollees.enrollee_id_numb
meminfotest ON users.id_number = meminfotest.Enrolle_id_num
	WHERE (users.user_id = #client.user_id#)
</cfquery>
There is a field in my Table 'enrollees' name of the field is new_member_type
So in my code if i display an cfouput i'm able to view the data in that field which is "FL".
So here is my question.
SINCE it's a FL level, the radio button in my code should 'CHECKED DISABLED' level A on that page.
So changes i should do to my
so my query is working very good.
I have a radio button question with 6 options.
<li><input type="radio" name="intOption" id="intOption1" value="1" onClick="Calculate_Sub_Tot
<cfif myQuery.somevalue is 1>
checked
</cfif>>
I will attached the code fo your review.
due-cfm.txt
ASKER
how i'm able to adjust this in my code, radio button.
<cfif myQuery.somevalue is 1>
checked
</cfif>>
<cfif myQuery.somevalue is 1>
checked
</cfif>>
ok - well it seems like you are saying that IF something is true then boxes are disabled.
<cfloop query="xxx">
<cfset disabled="">
<cfif disabledlogic eq somethingelse>
<cfset disabled="disabled">
</cfif>
<li><input type="radio" name="zzz" value="1" #disabled#>a
<li><input type="radio" name="zzz" value="2" #disabled#>b
<li><input type="radio" name="zzz" value="3" #disabled#>c
</cfloop>
<cfloop query="xxx">
<cfset disabled="">
<cfif disabledlogic eq somethingelse>
<cfset disabled="disabled">
</cfif>
<li><input type="radio" name="zzz" value="1" #disabled#>a
<li><input type="radio" name="zzz" value="2" #disabled#>b
<li><input type="radio" name="zzz" value="3" #disabled#>c
</cfloop>
ASKER
i mean Checked
So if the user is level FL, the BOX A should be Checked and the user can't changed.
So if the user is level FL, the BOX A should be Checked and the user can't changed.
ASKER
Could you please assist me, open my due-cfm.txt
on line 411,
the value is
<cfoutput> #DisplayUsers.new_member_t ype#</cfou put> So i'm having the result which is FL.
Now, how i'm able to apply it this change on my radio button,
<cfloop query="DisplayUsers">
<cfset disabled="">
<cfif disabledlogic eq somethingelse>
<cfset disabled="disabled">
</cfif>
<li><label class="order" for="intOption1095">A</lab el>
<input type="radio" name="intOption" id="intOption1095" value="1180" onClick="Calculate_Sub_Tot al()" class="formWidget">
<span class="details">$1180 *</span></li>
<li><input type="radio" name="zzz" value="3" #disabled#>c
</cfloop>
on line 411,
the value is
<cfoutput> #DisplayUsers.new_member_t
Now, how i'm able to apply it this change on my radio button,
<cfloop query="DisplayUsers">
<cfset disabled="">
<cfif disabledlogic eq somethingelse>
<cfset disabled="disabled">
</cfif>
<li><label class="order" for="intOption1095">A</lab
<input type="radio" name="intOption" id="intOption1095" value="1180" onClick="Calculate_Sub_Tot
<span class="details">$1180 *</span></li>
<li><input type="radio" name="zzz" value="3" #disabled#>c
</cfloop>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I have attached a picture of my SQL Table, please open it.
SQL-Table.jpg
SQL-Table.jpg
ASKER
As per your request, i have add this to my code.
<cfloop query="DisplayUsers">
<cfset disabled="">
<cfif DisplayUsers.new_member_ty pe eq "FL">
<cfset disabled="disabled">
</cfif>
<li><label class="order" for="intOption1095">A</lab el>
<input type="radio" name="intOption" id="intOption1095" value="1180" onClick="Calculate_Sub_Tot al()" class="formWidget" #disabled#>
<span class="details">$1180 *</span></li></cfloop>
So as a result A $1180 * was not checked... It should be checked :(
any idea please.
<cfloop query="DisplayUsers">
<cfset disabled="">
<cfif DisplayUsers.new_member_ty
<cfset disabled="disabled">
</cfif>
<li><label class="order" for="intOption1095">A</lab
<input type="radio" name="intOption" id="intOption1095" value="1180" onClick="Calculate_Sub_Tot
<span class="details">$1180 *</span></li></cfloop>
So as a result A $1180 * was not checked... It should be checked :(
any idea please.
ASKER
I have tried this one and it didn't work.
<cfloop query="DisplayUsers">
<cfset disabled="">
<cfif DisplayUsers.new_member_type eq "FL">
<cfset intoption="checked">
<li><label class="order" for="intOption1095">A</label>
<input type="radio" name="intOption" id="intOption1095" value="1180" onClick="Calculate_Sub_Total()" class="formWidget">
<span class="details">$1180 *</span></li>
</cfif>
</cfloop>
ASKER
Maybe something like that should work, what do you think... since i have the value of type...
<cfset intOption = "#DisplayUsers.new_member_ type#">
<li><label class="order" for="intOption1095">A</lab el>
<input type="radio" name="intOption" id="intOption1095" value="1180" onClick="Calculate_Sub_Tot al()" class="formWidget">
<span class="details">$1180 *</span></li>
<cfset intOption = "#DisplayUsers.new_member_
<li><label class="order" for="intOption1095">A</lab
<input type="radio" name="intOption" id="intOption1095" value="1180" onClick="Calculate_Sub_Tot
<span class="details">$1180 *</span></li>
ASKER
Please reply on my other question
https://www.experts-exchange.com/questions/27695395/CFIF-statement.html
https://www.experts-exchange.com/questions/27695395/CFIF-statement.html
I'm guessing this:
You are looping over a query
you have radio boxes that have a value (does this value come from the query? or does it come from some other concept?)
and you want one of the boxes checked IF what ??? (I'm guessing if something about it (the value?) matches something else - what is this something else? another query value?)
so could you answer these please?
here is a quick ex that might be close to what you are doing - note that an elements id must be unique or any js you try to run on it will fail
<li><input type="radio" name="intOption" id="intOption1" value="1" onClick="Calculate_Sub_Tot
<cfif myQuery.somevalue is 1>
checked
</cfif>>
<li><input type="radio" name="intOption" id="intOption2" value="2" onClick="Calculate_Sub_Tot
<cfif myQuery.somevalue is 2>
checked
</cfif>>
<li><input type="radio" name="intOption" id="intOption3" value="3" onClick="Calculate_Sub_Tot
<cfif myQuery.somevalue is 3>
checked
</cfif>>