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!
Code:
var hasbeenset = false;
function setInput(id){
if(hasbeenset)
{
document.getElementById("myinput2").value= id;
}
else if
(hasbeenset=true)
{
document.getElementById("myinput").value=id;
}
else
{
document.getElementById("myinput3").value=id;
}
}
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.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.