Skip to Content
avatar image
Former Member

Change the value in the input field

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Jun 13, 2007 at 09:42 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 13, 2007 at 09:47 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 13, 2007 at 09:53 AM

    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

    Add comment
    10|10000 characters needed characters exceeded