hi Kiran - you could also skip all that and just use javascript; using js will allow you to control the values on your form without necessarily needing to refresh the page to do so.
i've attached a very simple project to demonstrate.
here's a quick instruction on how to do it:
Give the dropdown a unique control id:
and give the textbox you want to affect a unique control id:
then, right-click anywhere in an empty space on the form (or double-click) and click Edit Form.
go to the Behavior tab and add a new AttributesKeyValuePair.
IMPORTANT!
if you copy/paste from the code snippets below, paste the text first into notepad, and then copy from notepad into the workflow text creator. this will strip the formatting and ensure no errors occur when the workflow and browser attempt to parse the script.
Event: onload
Event handler:
var t1 = document.getElementById('testvalue1');
var t2 = document.getElementById('testvalue2');
t1.setAttribute('oninput','checkDrop()');
t1.setAttribute('onchange','checkDrop()');
checkDrop();
Back on the Behavior tab, at the bottom, is the Script section. Enter this code into the script section:
function checkDrop() {
var t1 = document.getElementById('testvalue1');
var t2 = document.getElementById('testvalue2');
t2.value = t1.options[t1.selectedIndex].text;
}
Note that we are building a function in the Script section called "checkDrop" that is called on page load (we've attached the function call to the "onchange" and "oninput" events of the dropdown in the event handler, above).
This should work the way you indicated.
While this method probably seems complicated if you're unacquainted with javascript, once you've figured out how to include javascript actions in your workflow pages, a nice new world of UI functionality and user experience opens up.
Do reply and let me know how it goes.
-andrew