•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JSP section within the Web Development category of DaniWeb, a massive community of 373,926 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,291 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JSP advertiser: Lunarpages JSP Web Hosting
Views: 2223 | Replies: 1
![]() |
•
•
Join Date: Apr 2005
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
I'm desperately trying to finish of a site for my writers club and I know nothing about programing only got as far as I have care of WYSIWYG program.
Anyway I want to insert a series of forms in one of the pages giving random Male Names, Female Names, Places, Events. With a little help I designed a form which let me pick random first names. I called this form 'Form1.' I then thought if I duplicated that form that I could just change the Male Names to Female Names - why was I so stupid - both boxes showed Female Names.
Anyway I'm not a programer, all I'm interested in doing is putting this particular bit of our site together. I really would appreciate some help.
Here is what I have so far.
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
<body bgcolor="#FFFFFF" onLoad="MM_preloadImages('../network%20images/about_f2.gif','../network%20images/marketing_f2.gif','../network%20images/comp_f2.gif','../network%20images/library_f2.gif','../network%20images/try_f2.gif','../network%20images/contacts_f2.gif')">
<div id="Layer3" style="position:absolute; left:10px; top:78px; width:200px; height:160px; z-index:3">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><form name="Form1" method="get" action="">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/JavaScript">
fnames=["male1","male2","male3","male4","male5","male6"];
function getRandomFromArrays(){var a=arguments,aa=a.length,tmp=[];
while(aa--){
tmp.push(a[aa][new Date()%a[aa].length])
}
return tmp.reverse();
}
function populateFields(f1,a1){
f1.value=getRandomFromArrays(a1)[0];
}
</script></head>
<body> <Place action="" method="get" name="f">
<p>
<input name="first" type="text">
<p>
<input name="btn" type="button" value="Click" onClick="populateFields(first,fnames)">
</form>
</td>
</tr>
<tr>
<td><form name="Form2" method="get" action="">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/JavaScript">
fnames=["female1","female2","female3","female4","female5","female6"];
function getRandomFromArrays(){var a=arguments,aa=a.length,tmp=[];
while(aa--){
tmp.push(a[aa][new Date()%a[aa].length])
}
return tmp.reverse();
}
function populateFields(f1,a1){
f1.value=getRandomFromArrays(a1)[0];
}
</script></head>
<body> <Place action="" method="get" name="f">
<p>
<input name="first" type="text">
<p>
<input name="btn" type="button" value="Click" onClick="populateFields(first,fnames)">
</form>
</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</div>
</body>
</html>
Any help would be appreciated
Kevin
Anyway I want to insert a series of forms in one of the pages giving random Male Names, Female Names, Places, Events. With a little help I designed a form which let me pick random first names. I called this form 'Form1.' I then thought if I duplicated that form that I could just change the Male Names to Female Names - why was I so stupid - both boxes showed Female Names.
Anyway I'm not a programer, all I'm interested in doing is putting this particular bit of our site together. I really would appreciate some help.
Here is what I have so far.
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
<body bgcolor="#FFFFFF" onLoad="MM_preloadImages('../network%20images/about_f2.gif','../network%20images/marketing_f2.gif','../network%20images/comp_f2.gif','../network%20images/library_f2.gif','../network%20images/try_f2.gif','../network%20images/contacts_f2.gif')">
<div id="Layer3" style="position:absolute; left:10px; top:78px; width:200px; height:160px; z-index:3">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><form name="Form1" method="get" action="">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/JavaScript">
fnames=["male1","male2","male3","male4","male5","male6"];
function getRandomFromArrays(){var a=arguments,aa=a.length,tmp=[];
while(aa--){
tmp.push(a[aa][new Date()%a[aa].length])
}
return tmp.reverse();
}
function populateFields(f1,a1){
f1.value=getRandomFromArrays(a1)[0];
}
</script></head>
<body> <Place action="" method="get" name="f">
<p>
<input name="first" type="text">
<p>
<input name="btn" type="button" value="Click" onClick="populateFields(first,fnames)">
</form>
</td>
</tr>
<tr>
<td><form name="Form2" method="get" action="">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/JavaScript">
fnames=["female1","female2","female3","female4","female5","female6"];
function getRandomFromArrays(){var a=arguments,aa=a.length,tmp=[];
while(aa--){
tmp.push(a[aa][new Date()%a[aa].length])
}
return tmp.reverse();
}
function populateFields(f1,a1){
f1.value=getRandomFromArrays(a1)[0];
}
</script></head>
<body> <Place action="" method="get" name="f">
<p>
<input name="first" type="text">
<p>
<input name="btn" type="button" value="Click" onClick="populateFields(first,fnames)">
</form>
</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</div>
</body>
</html>
Any help would be appreciated
Kevin
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb JSP Marketplace
Similar Threads
- Forms in Random access files (Visual Basic 4 / 5 / 6)
- Forms authorization, only want a few links (ASP.NET)
- Fun with Forms (PHP)
- Identification of Web Forms (ASP.NET)
- Hotmail and Submitting Forms (Web Browsers)
Other Threads in the JSP Forum
- Previous Thread: I think I'm going to cry...
- Next Thread: jsp will lost its session while subdomain-rewrite applied



Linear Mode