How to fill in a Text Box Prompt with database value
To fill in a Text Box Prompt with database value, we need a value prompt (for example, a dropdown combo box) to pull data out of database and then pass to the Text Box prompt. By the way, you can always hide the drop down to not display it.
Below is a piece of sample code to be put into a HTML item. (replace $$ with <> )
$$script type="text/javascript"$$
function init()
{
document.forms["formWarpRequest"]._oLstChoicesDROPDOWN[2].selected = "true";
document.forms["formWarpRequest"]._textEditBoxHEADER.value = document.forms["formWarpRequest"]._oLstChoicesDROPDOWN[2].value;
}
$$/script$$
$$body onLoad=init()$$
The Text Box is called "HEADER", and the value prompt is called "DROPDOWN"
The first statement selected the line 2 in the drop down, this is not necessary to pass info to the Text Box, just an example how you could make a default selection in a value prompt.
The 2nd statement passes the line 2 in the drop down to the Text Box and display it by default.
First created Dec 05, 2008
Below is a piece of sample code to be put into a HTML item. (replace $$ with <> )
$$script type="text/javascript"$$
function init()
{
document.forms["formWarpRequest"]._oLstChoicesDROPDOWN[2].selected = "true";
document.forms["formWarpRequest"]._textEditBoxHEADER.value = document.forms["formWarpRequest"]._oLstChoicesDROPDOWN[2].value;
}
$$/script$$
$$body onLoad=init()$$
The Text Box is called "HEADER", and the value prompt is called "DROPDOWN"
The first statement selected the line 2 in the drop down, this is not necessary to pass info to the Text Box, just an example how you could make a default selection in a value prompt.
The 2nd statement passes the line 2 in the drop down to the Text Box and display it by default.
First created Dec 05, 2008

0 Comments:
Post a Comment
<< Home