Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to have the capability to select a record ????

Status
Not open for further replies.

request

Programmer
Joined
Dec 5, 2001
Messages
76
Location
US
I need to display a list of employee numbers on the screen . I need the capability to be able to select any employee number and press the submit button.

How can I do it???? I believe we can do it in CFGRID but I am not sure how to do it. Also once the employee number is selected, how will be it referenced on the action page???

I do not want the employee number to be a hyperlink.

Thanks a lot.
 
You can use a checkbox or radio button. (Use a checkbox if you want to select multiple people) Give the value of the radio button the value of the employee id. On the posting page, you reference it as #form.fieldname# where fieldname is the name of the formfield you specified.

e.g
<form action=&quot;page2.cfm&quot; method=&quot;post&quot;>
<cfoutput query=&quot;MyQuery&quot;>
<input type=&quot;radio&quot; name=&quot;frmEmployeeID&quot; value=&quot;#myQuery.employee_id#> #EmployeeName#
</cfoutput>
<input type=&quot;submit>
</form>

Page2.cfm
<cfoutput>
The employee ID you selected is #form.frmEmployeeiD#
</cfoutput>

I don't mean to sound harsh, but this is some of the basics of CF. You might want to check out the Developing Cold Fusion applications section of the CF documenation. There are a number of examples that will show you what you need to do.

HTH,
Tim P.
 
I actually have a similar program that allows our phone operators to drill down into employee information based on a name or employee number search.

This is one for one drill down using a URL and does not require radio buttons or check boxes.

I do a
<a href=&quot;page.cfm?enum=#enum#&dept=#dept#&quot;>#EmployeeName#</a>


This outputs the data as a standard HTML link that you or a user can click on.

This calls another CF page that pulls the data based on the URL variables passed to it. You would access the url variables by doinga URL.<variable_name>, similar to the FORM.<var_name> function.

Hope this helps!

Roger Pray
PC Systems Analyst
Bassett Healthcare
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top