Function for Input Boxes
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 2 of 2

Thread: Function for Input Boxes

  1. #1
    Join Date
    Mar 2013

    Unhappy Function for Input Boxes


    Summary of task: Click on text, it appears in input box 1. Click on another text, it appears in box 2. Click again, box 3. If the first box has text in it, it will appear in the second, and so on.

    However in the function below, the text never goes to Box 3. I don't know how to fix it!

    var hasbeenset = false;
    function setInput(id){
    document.getElementById("myinput2").value= id;
    else if
    Attached Files Attached Files

  2. #2
    Join Date
    Aug 2011
    West Yorkshire, U.K.

    Re: Function for Input Boxes

    Err ... this is javascript not java !!!
    Your code might work better if you do something along the lines of: check if input 1 is blank (null or zero length string). If it is, set its contents to id, otherwise check if input 2 is blank. If it is, set its contents to id otherwise set input 3 contents to id.

Tags for this Thread

Posting Permissions

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

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

This is a survey!

HTML5 Development Center