Jump to content
  • 0

Display Multiple Fields In A Lookup


OKProgram

Question

Is there a way to display multiple fields in a Lookup?  My DataPage adds records to an Activity Log.  Some activities are related to a record in the Students table, some are not.  I would like to have a Lookup Table for the Student_ID field that displays First_Name and Last_Name from the Students table, but the value for the field is Student_ID. The field can also be left blank.

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Found this script worked:

 
<SCRIPT LANGUAGE="JavaScript">
 
function concatenate()
{
var first_name = document.getElementById("InsertRecordFirst_Name").value;
var last_name = document.getElementById("InsertRecordLast_Name").value;
 
var full_name = first_name + " " + last_name;
 
document.getElementById("InsertRecordFull_Name").value = full_name;
 
}
 
document.getElementById("caspioform").onsubmit=concatenate;
</SCRIPT>
Link to comment
Share on other sites

  • 0

yes, first add a pre-concatenated field to your Students table. Going forward, use hidden fields and javascript to concatenate on submission. Use this as a guide for the needed javascript. 

http://howto.caspio.com/tech-tips-and-articles/common-customizations/separate-input-fields-for-datetime-parts/

 

 

Next, make a dropdown on the Students table, filtered by ID, Display as First Last, Value as ID.

Link to comment
Share on other sites

  • 0

Having trouble with the javascript.  Would you mind reviewing? My target field is named Full_Name. Not sure how to pass parameters.

 

<script>
document.getElementById('Submit').onmouseover = function(){
var first_name =
document.getElementById('cbParamVirtual1').value;
var last_name = 
document.getElementById('cbParamVirtual2').value;
document.getElementById('InsertRecordFull_Name').value = first_name + " " + last_name;
};
</script>
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...