Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-03-2007, 03:29 PM   PM User | #1
cup80
New Coder

 
Join Date: Feb 2007
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
cup80 is an unknown quantity at this point
Smile Linking Pages together

Hi there,

I have the following code:

Code:
<html>

<head>
<title>Symantec Quote Calculator</title>
<script language="JavaScript" type="text/javascript">
<!--
window.resizeTo(400, 600)
function zxcES(zxcele,zxcstyle,zxcp,zxctxt){
 if (typeof(zxcele)=='string'){ zxcele=document.createElement(zxcele); }
 for (key in zxcstyle){ zxcele.style[key]=zxcstyle[key]; }
 if (zxcp){ zxcp.appendChild(zxcele); }
 if (zxctxt){ zxcele.appendChild(document.createTextNode(zxctxt)); }
 return zxcele;
}

function zxcNext(zxcfrm){
 var zxccnt=zxcfrm.count.value;
 var zxccost=zxcfrm.cost.value;
 var zxcdivs=document.getElementById('selected').childNodes
 var zxclanguages='';
 for (var zxc0=0;zxc0<zxcdivs.length;zxc0++){
  zxclanguages+=zxcdivs[zxc0].firstChild.data+':';
 }
 if (zxccnt<1||zxclanguages==''){
  alert('Please select the Number of Words and the Language to Translate');
  return;
 }
 zxclanguages+='^'+zxccnt+'^'+zxccost;
}

function zxcReview(zxcrad){
 var zxcfrm=zxcrad.form;
 zxcfrm.cost.value=zxcfrm.hiddencost.value*1+zxcrad.value*(zxcLanguages.length-1);
}

//-->
</script>

<script language="JavaScript" type="text/javascript">
<!--

var zxcDays=1;       // The cookie will be available on revisits for a specified number of days
var zxcCookie='Language1';        // The Cookie name


function zxcSetFormCookie(zxcvalue){
 document.cookie=zxcCookie+"="+encodeURI(zxcvalue)+";expires="+zxcExp+";path=/;"
}

var zxcExp=new Date(new Date().getTime()+zxcDays*86400000).toGMTString();
var zxcLanguages;

function zxcCookieValue(){
 var zxcstring=zxcGetCookie(zxcCookie).split('^');
 var zxcfrm=document.LanguageForm;
 zxcfrm.count.value=zxcstring[1];
 zxcfrm.cost.value=zxcstring[2];
 zxcfrm.hiddencost.value=zxcstring[2];
 zxcLanguages=zxcstring[0].split(':');
 var zxcselected=document.getElementById('selected');
 for (var zxc0=0;zxc0<zxcLanguages.length-1;zxc0++){
  zxcES('DIV',{position:'relative',left:'0px',height:'21px',backgroundColor:'#FFD700',fontSize:'20px', borderBottom:'solid black 1px',paddingLeft:'5px',paddingRight:'5px',paddingBottom:'5px',paddingTop:'5px'},zxcselected,zxcLanguages[zxc0]);
 }
}

function zxcGetCookie(name) {
 var zxcst=document.cookie.indexOf(name+"=");
 var zxclen=zxcst+name.length+1;
 if ((!zxcst)&&(name != document.cookie.substring(0,name.length))) return null;
 if (zxcst==-1) return null;
 var zxcend=document.cookie.indexOf(";",zxclen);
 if (zxcend==-1) zxcend=document.cookie.length;
 return decodeURI(document.cookie.substring(zxclen,zxcend));
}

//-->
</script>

<style type="text/css">

body
{
width: 800px;
height: 600px;
}

fieldset.formFieldSet {
padding: 10px;
width: 325px;
border:solid #000000;
}
<!--
.style2 {font-family: "Symantec Sans Medium"}
-->
</style>
</head>

<body bgcolor="#FFFF00" onload="zxcCookieValue();">
<fieldset class="formFieldSet">
<center>
<form name="LanguageForm" action="DTP.html" onsubmit="this.YourHiddenElementName.value=cost()" >
<span class="style2">You have specified Words: </span>
<input name="count" type="text" size="7" onkeyup="return false;">
<br><br>
<br>
<br>
<span class="style2">
You have selected the following Languages.
</span>
<br><br>
<div id="selected" style="position:relative;width:100px;" ></div>
<br><br>
<span class="style2">Total Cost In Euros</span>:
<input name="cost" type="text" size="7" onkeyup="return false;">
<input name="hiddencost" type="hidden" size="7">
<br><br>
Do you need external review? <input type="radio" value="30" name="review" onclick="zxcReview(this);" >yes | no<input type="radio" value="0" name="review" onclick="zxcReview(this);">
<br><br>
<span onclick="document.getElementById('adiv').innerHTML='DTP'>
<br>


<div id="adiv"></div>
<br><br>
<input type="button" value="Next" onclick="zxcNext(this.form);" >
<input type="reset" value="Clear">
</form>

<br><br>
<img src="symyellowback.png" width="279" height="71">
</form>
</center>
</body>
and I would like to link this page to this page:


Code:
<html>

<head>
<title>Symantec Quote Calculator</title>
<script language="JavaScript" type="text/javascript">
<!--

</script>
<style type="text/css">
window.resizeTo(400, 600)
body
{
width: 800px;
height: 600px;
}

fieldset.formFieldSet {
padding: 10px;
width: 325px;
border:solid #000000;
}
<!--
.style2 {font-family: "Symantec Sans Medium"}
-->
</style>
</head>

<body bgcolor="#FFFF00">
<fieldset class="formFieldSet">
<FORM NAME="myForm">
Does document need DTP? 
<input type="radio"  name="Y1" onClick="document.myForm.hiddenObject.value=this.value">yes | no<input type="radio" name="N1">
<br><br>
<INPUT TYPE="hidden" NAME="hiddenObject" VALUE="None">
How many PDF Pages does your document have?
<br><br>
<select name="sel"  >
<option value="" >Select Pages</option>
<option value="50" >1 - 5</option>
<option value="100" >5 - 10</option>
<option value="150" >10 - 15</option>
<option value="200" >15 - 20</option>
<option value="300" >20+</option>
</form>
<br><br>
<img src="symyellowback.png" width="279" height="71">

</center>
</body>
and I would also like to carry over the previous information from the 1st piece of code.

Can anyone help or needs any further info give me a shout.

Many thanks in advance

Cup
cup80 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:57 PM.


Advertisement
Log in to turn off these ads.