Hello,
I have the following code that works perfectly ….. except that the fields are not correctly formatted.
If you try to execute it you will see, for instance, that the comments, the fields are not aligned under each other.
I don’t know how to do it! I have tried to enclose the form in the <table> tag but it does not work.
And there is something “funny” as well, I would like the following comment: “Número máximo de conexiones” AND the field to be on the same line…. but it is not!!!!
Could someone help me with it?
Many thanks
=================================
<html>
<head>
<title></title>
<style type=”text/css”>
<!–
#menu {
position:relative;
font-family: Arial, Helvetica, sans-serif;
width:400px;
}
–>
</style>
<script language=”JavaScript” type=”text/JavaScript”>
subcol=’white’;//El bgcolor de los sub-enlaces
indent=20;//La indentacion a la izquiereda en pixels
function coll()
{
var dd=document.getElementById(‘menu’).getElementsByTagName(‘div’);
for (var i=1;i<dd.length;i=i+2)
{
dd[i].style.position=’relative’;
dd[i].style.display=’none’;
dd[i].style.backgroundColor=subcol;
dd[i].style.left=indent+’px’;
}
}
function tab(w)
{
var d=w.parentNode.getElementsByTagName(‘div’)[0];
if (d.style.display==’none’)
{
document.getElementById(‘L1’).focus();
}
}
function activ(w)
{
var d=w.parentNode.getElementsByTagName(‘div’)[0];
if(d.style.display==’none’)
{
coll();d.style.display=’inline’;
}
else
{
d.style.display=’none’;
}
}
onload=coll;
function formValid()
{
alert(“formValid”);
document.forms[0].submit();
}
</script>
</head>
<body>
<form action=”” method=post>
<P>Contraseña:
<input type=text name=”password” tabindex=1 maxlength=31 >
<!– Menu –>
<div id=”menu”>
<bl>
<%
String type=”1″;
if (type.equals(“1”)) // tipo = 2 => Service A cannot exist
{
%>
<!– Service A –>
<div><li><a href=”#” id=”L1″ tabindex=1 onclick=”activ(this)”>ServiceA</a><br>
<div>
Contraseña túnel:<input type=text name=”name” tabindex=2 max
length=15 ><br>
Salvad la contraseña?:
<input type=”Radio” name=”radioa” tabindex=4 value=”si” >Si
<input type=”Radio” name=”radioa” tabindex=5 value=”no” checked>No
</div>
</div>
<!– FIN Service A –>
<%
}
String usu=”Msisdn”;
String siz=”18″;
if (!type.equals(“1”))
{
usu=”Usuario”;
siz=”15″;
}
%>
<!– Service B –>
<br>
<div><li><a href=”#” onclick=”activ(this)” tabindex=4>ServiceB</a><
br>
<div>
<%=usu%>:</td><td><input type=text name=”usu” tabindex=2 maxlength=<%=siz%
> ><br>
* Número máximo de conexiones:<input type=text name=”con_max”
tabindex=3 maxlength=10 ><br>
<input type=”Radio” name=”c_auth” tabindex=4 value=”si” checked>Si
<input type=”Radio” name=”c_auth” tabindex=5 value=”no” >No
<br>
* Autenticación por MSISDN llamante?:
<input type=”Radio” name=”a_auth” tabindex=4 value=”si” checked>Si
<input type=”Radio” name=”a_auth” tabindex=5 value=”no” >No
<br>
</div>
</div>
<!– FIN Servicios No Externos –>
</bl>
</div>
<!– END Menu –>
<input type=hidden name=”generico1″ maxlength=32 value=”0″>
<input type=hidden name=”generico2″ maxlength=32 value=”0″>
<input type=hidden name=”accesos_validos” maxlength=64 tabindex=10 value=”0″>
<input onclick=formValid() type=button value=Alta name=Submit tabindex=11>
<input onblur=focusField() onclick=del() type=button value=Borrar tabindex=12>
</form>
</body>
</html>
isService = document.getElementById(ID);
if (isService.style.display == 'none'){isService.style.display = 'inline'}
else {isService.style.display = 'none'}
alert(isVal)
currService = document.getElementById(currID);
if (currService.style.display == 'none')
{
currService.style.display = 'inline';
isOpp = document.getElementById(oppID);
if (isOpp.style.display == 'inline'){isOpp.style.display = 'none'}
}
else {
currService.style.display = 'none'
isOpp = document.getElementById(oppID);
if (isOpp.style.display == 'inline'){isOpp.style.display = 'none'}
}
isPass = document.forms[0].password.value;
isName = document.forms[0].name.value;
isUsu = document.forms[0].usu.value;
isMax = document.forms[0].con_max.value;
alert(isPass+", "+isName+", "+isUsu+", "+isMax)
// You can validate each text field here;
document.forms[0].submit();
currService = document.getElementById(currID);
if (currService.style.display == 'none')
{
currService.style.display = 'inline';
isOpp = document.getElementById(oppID);
if (isOpp.style.display == 'inline'){isOpp.style.display = 'none'}
}
else {
currService.style.display = 'none'
isOpp = document.getElementById(oppID);
if (isOpp.style.display == 'inline'){isOpp.style.display = 'none'}
}
activeService = currService;
currService = document.getElementById(currID);
if (currService.style.display == 'none')
{alert()
currService.style.display = 'inline';
isOpp = document.getElementById(oppID);
if (isOpp.style.display == 'inline'){isOpp.style.display = 'none'}
}
else {alert()
currService.style.display = 'none'
isOpp = document.getElementById(oppID);
if (isOpp.style.display == 'inline'){isOpp.style.display = 'none'}
}
activeService = currService;
currService = document.getElementById(currID);
if (currService.style.visibility == 'hidden')
{
currService.style.visibility = 'visible';
isOpp = document.getElementById(oppID);
if (isOpp.style.visibility == 'visible'){isOpp.style.visibility = 'hidden'}
}
else {
currService.style.visibility = 'hidden'
isOpp = document.getElementById(oppID);
if (isOpp.style.visibility == 'visible'){isOpp.style.visibility = 'hidden'}
}
activeService = currService;
isPass = document.forms[0].password.value;
isName = document.forms[0].name.value;
isUsu = document.forms[0].usu.value;
isMax = document.forms[0].con_max.value;
alert(isPass+", "+isName+", "+isUsu+", "+isMax)
// You can validate each text field here;
document.forms[0].submit();
document.getElementById('serviceA').style.visibility = 'hidden'
document.getElementById('serviceB').style.visibility = 'hidden'
currService = document.getElementById(currID);
if (currService.style.visibility == 'hidden')
{
activeService = currID;
currService.style.visibility = 'visible';
isOpp = document.getElementById(oppID);
if (isOpp.style.visibility == 'visible'){isOpp.style.visibility = 'hidden';}
}
else {
currService.style.visibility = 'hidden'
activeService = "";
isOpp = document.getElementById(oppID);
if (isOpp.style.visibility == 'visible'){isOpp.style.visibility = 'hidden'}
}
isPass = document.forms[0].password.value;
isName = document.forms[0].name.value;
isUsu = document.forms[0].usu.value;
isMax = document.forms[0].con_max.value;
alert(activeService)
//alert(isPass+", "+isName+", "+isUsu+", "+isMax)
// You can validate each text field here;
//document.forms[0].submit();
document.getElementById('serviceA').style.visibility = 'hidden'
document.getElementById('serviceB').style.visibility = 'hidden'
currService = document.getElementById(currID);
if (currService.style.visibility == 'hidden')
{
activeService = currID;
currService.style.visibility = 'visible';
isOpp = document.getElementById(oppID);
if (isOpp.style.visibility == 'visible'){isOpp.style.visibility = 'hidden';}
if (currID == 'serviceA'){document.forms[0].name.focus()}
if (currID == 'serviceB'){document.forms[0].usu.focus()}
}
else {
currService.style.visibility = 'hidden'
activeService = "";
isOpp = document.getElementById(oppID);
if (isOpp.style.visibility == 'visible'){isOpp.style.visibility = 'hidden'}
}
isPass = document.forms[0].password.value;
isName = document.forms[0].name.value;
isUsu = document.forms[0].usu.value;
isMax = document.forms[0].con_max.value;
//alert(activeService)
//alert(isPass+", "+isName+", "+isUsu+", "+isMax)
// You can validate each text field here;
//document.forms[0].submit();
document.getElementById('serviceA').style.visibility = 'hidden';
document.getElementById('serviceB').style.visibility = 'hidden';
document.forms[0].password.focus();
if (testValue >= 2)
{
document.getElementById('isA').style.visibility = 'hidden'
document.links[1].click();
document.forms[0].password.focus();
}
0.1.9 — BETA 5.28