Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    Posts
    8

    Unanswered: Need Help....short question

    Hi guys,


    Here is my problem.

    in my "page.php" i have a drop down menu and a textfield

    what i want to do is that if i select an option, the value i selected will be transfered automatically to the textfield with out clicking a button or a submit button

    i really need help with this stuf. tnx

  2. #2
    Join Date
    Jan 2004
    Location
    India
    Posts
    168

    Thumbs up Re: Need Help....short question

    Hi

    You can do this with the help of a javascript.
    First in the drop down menu you should make a parameter say "onChange='takevalue();'"This takevalue() is a javascript function. This you have to make. In this you have to take the value of the selected value from the drop down.
    eg:
    <SCRIPT language="JavaScript">
    function takevalue()
    {
    var st=document.test.sel.value;
    document.test.txtval.value=st;
    }
    </SCRIPT>

    <FORM NAME="test">
    <SELECT NAME="sel" onChange="takevalue();">
    <OPTION VALUE="1">Test 1</OPTION>
    <OPTION VALUE="Test 2">Test 2</OPTION>
    </SELECT>
    <INPUT TYPE="TEXT" NAME="txtval">
    </FORM>

    This will do exactly what you want.
    Just go through this code you will get some idea. Else please feel free to ask.

    Regards
    Rajesh


    Originally posted by cody7
    Hi guys,


    Here is my problem.

    in my "page.php" i have a drop down menu and a textfield

    what i want to do is that if i select an option, the value i selected will be transfered automatically to the textfield with out clicking a button or a submit button

    i really need help with this stuf. tnx

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •