cancel
Showing results for 
Search instead for 
Did you mean: 

Change the value in the input field

Former Member
0 Kudos

Hi all,

I have a form with one dropdown list and one input field. Is it possible when I select an entry in the dropdown list and then the input field is changed automatically to null.?

Thanks and regards,

Dicky

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

hi,

Have a script function like this

<script language='java'>

function onDNchange(){

document.getElementByID('txtBox').value="";

}

</script>

and the form should be like this

<form name='f1' onchange='javascript:onDNchange()'>

<select id='sOption'>

<option value=1>1</option>

<option value=2>2</option>

</select>

<input type='text' id='txtBox' value='some value'>

</form>

Regards,

Beevin

Former Member
0 Kudos

Hi Tamil K,

Thanks for your instant reply. But I have never tried java script in the Visual Composer Development Enviroment. Can you describe more details about that?

Thanks and regards,

Dicky

Former Member
0 Kudos

Hi,

I have given a sample code for ur requirement,but this is not specfic to VC.this is a general concept.u change it as u need.

<script>

function Select()

{

// Getting a Handle for the DropDown for City

var dropDownCity = eval(func("inputfield id"));

dropDownCity.setValue("");

}

</script>

<hbj:dropdownListBox

id="dropdown_city"

onClientSelect="Select()" //function

jsObjectNeeded="true">

<hbj:listBoxItem key="00" value="" />

<hbj:listBoxItem key="HD" value="Heidelberg" />

<hbj:listBoxItem key="WD" value="Walldorf" />

</hbj:dropdownListBox>

Follow the links also

http://help.sap.com/saphelp_nw70/helpdata/en/d0/55074155bcf26fe10000000a1550b0/frameset.htm

Regards,

Tamil K

Former Member
0 Kudos

You can do it VC by coding a formula for the InputField.

More details regarding how to Dynamic Expression refer to the document Page No:154

<a href="

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/63f2052e-0c01-

0010-b9a2-e1f7457a7fbe">https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/63f2052e-0c01-

0010-b9a2-e1f7457a7fbe</a>

Former Member
0 Kudos

Hi,

yes its possible. call a javascript function on selecting dropdown list box item.inside that function make the inputfield value as null.

Regards,

Tamil K