Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I have the following scenario. There are two tables, they are related in by the foreign key displayed in italics.
Table 1</b
table1IDint
table1descvarchar(20)
Table 2</b
table2IDint
table2descvarchar(20)
table1fkint
As you may have noticed, Table 2 contains the foreign key to Table 1, which is an intenger value (for the Autoincrement field in table 1). table1desc is really the value that matters for the user. It is the value that the user sees and selects when I display the pull-down menu in HTML and populate it with the contents of Table 1.

So my problem is as follows. When I display the list of values to the user I am forced to do so by displaying the foreign key value next to the description value in pairs(table1desc). Then, when the user submits the form, a script splits the values pairs to extract the foreign key, which is an integer.

I would like to know if there is a way to hide this value from the user without having to alter the table structure to make the description value (table1desc) the primary key. This is all because I don't want the user to see the value of the primary key of Table 1.

Thanks...


In reply to Multicolumn Pulldown Menu by rodry

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-24 04:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found