Background -
We are building a web page that has a series of questions and instructions to find the answers. When the tech is done, they click the yes or no button to move on.
There are also back buttons incase the tech needs to go back. The problem is that multiple questions can lead to the same result...so the back button needs to know what to do.
This was my first shot:
The variable lastLink is set earlier as a global variable
This works great, until you attempt to use another back button. Then lastLink and thisLink become the same. So no go.
Then I decided, that at this point...to get the page done...I would just decrement the values for all the rest of the back buttons. (This is only needed until they hit another yes or no...so not a big deal for launch.)
This is my attempt that is not working:
What I keep getting is that the parse is not pulling the number out of thisLink. An example of thisLink is internetRow1, or internetRow2. Those are the id's of the rows in my table...and I use them to hide or show rows.
It was my understanding that parseInt(thisLink) would only return the number. Then I can use that number to manipulate the next lowest numbered row and make it show.
But I am not getting numbers...I keep getting NAN in my test text field. What am I doing wrong that I cannot pull the number out?
Hope I explained that well enough.
Dave
"Credit belongs to the man who is actually in the arena - T.Roosevelt
We are building a web page that has a series of questions and instructions to find the answers. When the tech is done, they click the yes or no button to move on.
There are also back buttons incase the tech needs to go back. The problem is that multiple questions can lead to the same result...so the back button needs to know what to do.
This was my first shot:
Code:
function backButton(thisLink) {
hideBack = document.getElementById(thisLink);
showLast = document.getElementById(lastLink);
hideBack.style.display = hideBack.style.display = "none";
showLast.style.display = showLast.style.display = "block";
}
The variable lastLink is set earlier as a global variable
Code:
var lastLink = ""
function hideRows(matrix,inStr,oldLink) {
lastLink=oldLink;
((code continues....))
This works great, until you attempt to use another back button. Then lastLink and thisLink become the same. So no go.
Then I decided, that at this point...to get the page done...I would just decrement the values for all the rest of the back buttons. (This is only needed until they hit another yes or no...so not a big deal for launch.)
This is my attempt that is not working:
Code:
function backButton(thisLink) {
if (thisLink != lastLink){
hideBack = document.getElementById(thisLink);
showLast = document.getElementById(lastLink);
hideBack.style.display = hideBack.style.display = "none";
showLast.style.display = showLast.style.display = "block";
}
else {
nextRow = parseInt(thisLink);
showRow = document.getElementById("internetThreeArow" + nextRow );
hideBack = document.getElementById(thisLink);
hideBack.style.display = hideBack.style.display = "none";
showRow.style.display = showRow.style.display = "block";
}
}
What I keep getting is that the parse is not pulling the number out of thisLink. An example of thisLink is internetRow1, or internetRow2. Those are the id's of the rows in my table...and I use them to hide or show rows.
It was my understanding that parseInt(thisLink) would only return the number. Then I can use that number to manipulate the next lowest numbered row and make it show.
But I am not getting numbers...I keep getting NAN in my test text field. What am I doing wrong that I cannot pull the number out?
Hope I explained that well enough.
Dave
"Credit belongs to the man who is actually in the arena - T.Roosevelt