Jump to content
  • 0

Allocate A Value To A Field In A Data Table


alanhoffman

Question

Fingers crossed I get this information across in sufficient detail..

 

I have an app that runs produces a tabular data report...

 

I then have an HTML developed code that opens an Update form using parameters passed from the tabular data report.

 

The update form has several rows of data... Using a drop down box, I wish the user to select a value to update field A. At the same time, if the value of the field chosen is, say, "BR", A need to the form the update Field B with a value using one of the aforementioned parameters..

 

Any suggestions would be greatly received...

 

--------------------

 

Specifics:

 

Tabular Report: Availability Report

Parameters: @BookingID (unique) and @Virtual_Location_Name

 

Update Form: Booking

This produces 3 lines of data (representing different days e.g. Tue 14, Wed 15, Thu 16)

The Drop down boxes AV14 AV15 AV16 have options of BR, NA

If, say, AV15 is chosen to have value "BR", I wish field NE15 to be allocated parameter value @Virtual_Location_name but blank if any other field is chosen when Update is pressed on the form

------------------------------

 

Thanks again...

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hello Alan,

 

You can add the Header&Footer element, select the Footer, click the "Source" and enter the following code:

<SCRIPT LANGUAGE="JavaScript">
function set_param()
 {
    var inserted_value="[@Virtual_Location_name]";
    var v_dropdown = document.getElementById("EditRecordAV15");
    var selection = v_dropdown.options[v_dropdown.selectedIndex].value;
    if (selection=="BR") { document.getElementById("EditRecordNE15").value = inserted_value;}
    else { document.getElementById("EditRecordNE15").value = "";}
 }
document.getElementById("caspioform").onsubmit=set_param;
</SCRIPT>

If you want to check other fields, you can add lines like:

<SCRIPT LANGUAGE="JavaScript">
function set_param()
 {
    var inserted_value="[@Virtual_Location_name]";
    var inserted_value2="[@Virtual_Location_name2]";

    var v_dropdown = document.getElementById("EditRecordAV15");
    var selection = v_dropdown.options[v_dropdown.selectedIndex].value;
    if (selection=="BR") { document.getElementById("EditRecordNE15").value = inserted_value;}
    else { document.getElementById("EditRecordNE15").value = "";}

    var v_dropdown2 = document.getElementById("EditRecordAV16");
    var selection2 = v_dropdown2.options[v_dropdown2.selectedIndex].value;
    if (selection2=="BR") { document.getElementById("EditRecordNE16").value = inserted_value2;}
    else { document.getElementById("EditRecordNE16").value = "";}
 }
document.getElementById("caspioform").onsubmit=set_param;
</SCRIPT>

I hope, it helps.

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...