/    Sign up×
Community /Pin to ProfileBookmark

Major Help Needed For a Newbie

Hi guys I need some serious help

I created some inventory pages as a subsidiary of a quote page.
In these pages I am calculating the total weight (per page) and displaying it to the user in a field called “tot”. How do I transfer/feed the tot filed in the quote page?
Please help .

to post a comment
JavaScript

7 Comments(s)

Copy linkTweet thisAlerts:
@scragarMay 10.2005 — is the quote page in a frame or are you wanting it passed via cookies or what?
Copy linkTweet thisAlerts:
@raniauthorMay 10.2005 — i am new to the business and was actually looking for an advice.

if you wish to see the pages then the URL is:

www.stevensmovers.com/quote.html

and for the inventory pages just click on inventory.

Thanks
Copy linkTweet thisAlerts:
@scragarMay 10.2005 — I would use cookies.

and add a link from the invetory page, the info goes no-where.
Copy linkTweet thisAlerts:
@raniauthorMay 10.2005 — ok,

how do i do that ? as i said i am a newbie and this is the first site i am developing.
Copy linkTweet thisAlerts:
@scragarMay 10.2005 — document.cookie = "cookieName=CookieValue";

EG:

//record tot

document.cookie = "totalWeight="+tot;

//retrive tot

tot = ("0"+((document.cookie+"totalWeight=").split("totalWeight=")[1]+";").split(";")[0]) / 1;

//check it

alert(tot);
Copy linkTweet thisAlerts:
@raniauthorMay 10.2005 — i do apologize for nagging you but could you elaborate a bit ?

like where do i put this cookie and how do i use it ?

i never done that in my life

Cheers
Copy linkTweet thisAlerts:
@scragarMay 11.2005 — current(inventory): [code=php]function calc(){
//var ff=document.forms[0]
var ff=document.getElementsByTagName("INPUT"),f=ff.length,t=0,z;
while(f--){
if(ff[f].type=="text" && !isNaN(ff[f].value)){
z=ff[f].parentNode.previousSibling;
while(z.nodeType!=1) z=z.previousSibling;
t+= z.firstChild.data * ff[f].value;
}
}
document.getElementById("tot").firstChild.data=t;
}[/code]
try: [code=php]function calc(){
//var ff=document.forms[0]
var ff=document.getElementsByTagName("INPUT"),f=ff.length,t=0,z;
while(f--){
if(ff[f].type=="text" && !isNaN(ff[f].value)){
z=ff[f].parentNode.previousSibling;
while(z.nodeType!=1) z=z.previousSibling;
t+= z.firstChild.data * ff[f].value;
}
}
document.getElementById("tot").firstChild.data=t;
document.cookie = "totalWeight="+tot;
}[/code]

then where-ever you need to read it just add:
[code=php]var tot = ("0"+((document.cookie+"totalWeight=").split("totalWeight=")[1]+";").split(";")[0]) / 1;[/code]
×

Success!

Help @rani spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...