View Full Version : a text variable referred to in javascript not present on the screen

11-03-2012, 09:39 PM
The answer is probably trivial.

function VER5DN(){
n=n-1;if (n<1){n=b-1}
if(klass[n]==null){n=0};x=klass[n];v=new Array;x=x+"|";i=0;while(x.length>1){l=x.substring(0,x.indexOf("|"));v[i]=l;i++;x=x.substring(x.indexOf("|")+1)};


The last line in the code assigns a variable used in html to the outcome of the above readout from an array.

All works well, until I remove an input field from the html layout of the website. so as long as this field exists

<form name="klass">

<table border="1" cellspacing="3" cellpadding="3">
<td> <input type="button" value=" UP "

<input type="TEXT" name="VERFOR5_3" size="20" >

, the code works.

Since there are more of these fields and they mess up the layout of the site, I would like to somehow get rid of the variable being manifest on the page. But then the code stops working.

What is a more elegant way to make the variable exist in the html, without taking it to the screen?

11-04-2012, 10:05 AM
For example <input type="hidden" name="VERFOR5_3" />. This way the field will still be part of the form and will also be transmitted on submit.

11-04-2012, 05:08 PM
works great. thank you.