I have designed two HTML pages, docs_duplicate.html & links_duplicate.html. The functionality that I want to achieve is -
When I enter the required data in the docs_duplicate.html & hit enter, links_duplicate.html will get all the data. I achieved it EXCEPT for the RADIOBUTTON. I'm enclosing the code of bothe docs_duplicate.html & links_duplicate.html respectively.
Please help!!!
-------------------
docs_duplicate.html
-------------------
<HTML>
<head>
<title>Docs_Duplicate Page</title>
</head>
<body TOPMARGIN="0" LEFTMARGIN="50">
<form Action="links_duplicate.html">
<CENTER>
<table border='0' cellspacing=1 cellpadding=1 width=500 style="table-layout:fixed">
<col width=150>
<col width=150>
<col width=150>
<col width=150>
<TR><TR>
<TR><TR>
<TR><TR>
<TR>
<TD align="right" valign="middle"><font size=2><b>LASTMODF</b>
<TD align="left"><input type = text name="lastmod" size=15>
<TD align="right" valign="middle"><font size=2><b>DESCOPEPCR ID</b>
<TD align="left"><input type = text name="descopepcrid" size=15>
<TR>
<TD align="right" valign="middle"><font size=2><b>TSD DESC</b>
<TD align="left"><textarea name="tsddesc" rows=5 cols=12></textarea>
<TD align="right" valign="middle"><font size=2><b>ACTV TEST SCRT</b>
<TD align="left"><input type = radio name="activetestscr" value="0" onClick="0"><font size=2><b>YES<b>
<input type = radio name="activetestscr" value="1" onClick="1"><font size=2><b>NO</b>
</table>
<TABLE>
<TD>
<TH align=center><input type = submit Value = "SUBMIT" size="10"> <input type = submit Value = "CLEAR" size="10">
</TABLE>
</CENTER>
</form>
</body>
</html>
--------------------------------
--------------------
links_duplicate.html
--------------------
<html>
<head>
<title>Links_Duplicate Page</title>
</head>
<body TOPMARGIN="0" LEFTMARGIN="0">
<form name="links1">
<center>
<table border='0' cellspacing=2 cellpadding=3>
<TR><TR>
<TR><TR>
<TR><TR>
<TR>
<TR>
<TD align="left" valign="middle"><font size=2><b>LAST MODF</b>
<TD align="left" valign="middle"><font size=2><b>DESCOPEPCR ID</b>
<TD align="left" valign="middle"><font size=2><b>TSD DESC</b>
<TD align="left" valign="middle"><font size=2><b>ACTV TEST SCRT</b>
<TR>
<TD align="left"><input type = text name="lastmod" size =25 onFocus="this.blur();">
<TD align="left"><input type = text name="descopepcrid" size =25 onFocus="this.blur();">
<TD align="left"><textarea name="tsddesc" rows=5 col=10 onFocus="this.blur();"></textarea>
<TD align="left"><input type = radio name="activetestscr" value="0"><font size=2><b>YES<b>
<input type = radio name="activetestscr" value="1"><font size=2><b>NO</b>
</table>
</CENTER>
</form>
<script language="javascript">
<!-- hide
function replace(string,text,by) {
var i = string.indexOf(text);
var newstr = '';
if ((!i) || (i == -1))
return string;
newstr += string.substring(0,i) + by;
if (i+text.length < string.length)
newstr = newstr + replace(string.substring(i+text.length,string.length),text,by);
return newstr;
}
function getParm(string,parm) {
// returns value of parm from string
var startPos = string.indexOf(parm + "="
;
if (startPos > -1)
{
//alert("In If(startpos)"
;
startPos = startPos + parm.length + 1;
var endPos = string.indexOf("&",startPos);
if (endPos == -1)
endPos = string.length;
var x= unescape(string.substring(startPos,endPos));
return x;
}
return '';
}
//var passed = location.search.substring(1);
var passed = replace(location.search.substring(1),"+"," "
;
document.links1.lastmod.value = getParm(passed,'lastmod');
document.links1.descopepcrid.value = getParm(passed,'descopepcrid');
document.links1.tsddesc.value = getParm(passed,'tsddesc');
document.links1.activetestscr[getParm(passed,'activetestscr')].value = true;
// show me -->
</script>
</body>
</html>
--------------------------
When I enter the required data in the docs_duplicate.html & hit enter, links_duplicate.html will get all the data. I achieved it EXCEPT for the RADIOBUTTON. I'm enclosing the code of bothe docs_duplicate.html & links_duplicate.html respectively.
Please help!!!
-------------------
docs_duplicate.html
-------------------
<HTML>
<head>
<title>Docs_Duplicate Page</title>
</head>
<body TOPMARGIN="0" LEFTMARGIN="50">
<form Action="links_duplicate.html">
<CENTER>
<table border='0' cellspacing=1 cellpadding=1 width=500 style="table-layout:fixed">
<col width=150>
<col width=150>
<col width=150>
<col width=150>
<TR><TR>
<TR><TR>
<TR><TR>
<TR>
<TD align="right" valign="middle"><font size=2><b>LASTMODF</b>
<TD align="left"><input type = text name="lastmod" size=15>
<TD align="right" valign="middle"><font size=2><b>DESCOPEPCR ID</b>
<TD align="left"><input type = text name="descopepcrid" size=15>
<TR>
<TD align="right" valign="middle"><font size=2><b>TSD DESC</b>
<TD align="left"><textarea name="tsddesc" rows=5 cols=12></textarea>
<TD align="right" valign="middle"><font size=2><b>ACTV TEST SCRT</b>
<TD align="left"><input type = radio name="activetestscr" value="0" onClick="0"><font size=2><b>YES<b>
<input type = radio name="activetestscr" value="1" onClick="1"><font size=2><b>NO</b>
</table>
<TABLE>
<TD>
<TH align=center><input type = submit Value = "SUBMIT" size="10"> <input type = submit Value = "CLEAR" size="10">
</TABLE>
</CENTER>
</form>
</body>
</html>
--------------------------------
--------------------
links_duplicate.html
--------------------
<html>
<head>
<title>Links_Duplicate Page</title>
</head>
<body TOPMARGIN="0" LEFTMARGIN="0">
<form name="links1">
<center>
<table border='0' cellspacing=2 cellpadding=3>
<TR><TR>
<TR><TR>
<TR><TR>
<TR>
<TR>
<TD align="left" valign="middle"><font size=2><b>LAST MODF</b>
<TD align="left" valign="middle"><font size=2><b>DESCOPEPCR ID</b>
<TD align="left" valign="middle"><font size=2><b>TSD DESC</b>
<TD align="left" valign="middle"><font size=2><b>ACTV TEST SCRT</b>
<TR>
<TD align="left"><input type = text name="lastmod" size =25 onFocus="this.blur();">
<TD align="left"><input type = text name="descopepcrid" size =25 onFocus="this.blur();">
<TD align="left"><textarea name="tsddesc" rows=5 col=10 onFocus="this.blur();"></textarea>
<TD align="left"><input type = radio name="activetestscr" value="0"><font size=2><b>YES<b>
<input type = radio name="activetestscr" value="1"><font size=2><b>NO</b>
</table>
</CENTER>
</form>
<script language="javascript">
<!-- hide
function replace(string,text,by) {
var i = string.indexOf(text);
var newstr = '';
if ((!i) || (i == -1))
return string;
newstr += string.substring(0,i) + by;
if (i+text.length < string.length)
newstr = newstr + replace(string.substring(i+text.length,string.length),text,by);
return newstr;
}
function getParm(string,parm) {
// returns value of parm from string
var startPos = string.indexOf(parm + "="
if (startPos > -1)
{
//alert("In If(startpos)"
startPos = startPos + parm.length + 1;
var endPos = string.indexOf("&",startPos);
if (endPos == -1)
endPos = string.length;
var x= unescape(string.substring(startPos,endPos));
return x;
}
return '';
}
//var passed = location.search.substring(1);
var passed = replace(location.search.substring(1),"+"," "
document.links1.lastmod.value = getParm(passed,'lastmod');
document.links1.descopepcrid.value = getParm(passed,'descopepcrid');
document.links1.tsddesc.value = getParm(passed,'tsddesc');
document.links1.activetestscr[getParm(passed,'activetestscr')].value = true;
// show me -->
</script>
</body>
</html>
--------------------------