There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
acer black screen boot bsod computer connection crash css dell display driver drivers email error ethernet excel explorer firefox firefox 3 game hard drive internet internet explorer itunes laptop linux malware monitor network networking nvidia outlook outlook 2003 outlook express partition password printer problem router slow software sound trojan usb video virus vista windows windows xp wireless
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
Javascript--complete novice--question


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
piamik2's Avatar
Senior Member with 109 posts.
 
Join Date: Mar 2005
Experience: Intermediate
01-Dec-2005, 04:18 PM #1
Javascript--complete novice--question
I know practically nothing about javascript or html, save what I've learned on the net and from some library books so please be patient with me.

I'm trying to put together a very simple form that will calculate the price of an order of tickets for a local community theater group. Someone suggested javascript since it will manipulate data without using ActiveX.

So, I have made a very basic form which allows one to select a performance date and the number of tickets, and then calculates the price of the tickets.

I have a couple of questions.

First, we have 3 different ticket prices: adult, senior and student. So, right off the bat I have 3 calcultions to make. It's the same procedure each time and the way I have set it up right now, I have a bunch of different function calls for each calculation. This is how it goes for one type of ticket, A standing for adult:

function calcA(){
document.PPFTixOrd.TixAOrd$.value =document.PPFTixOrd.TixANum.value* document.PPFTixOrd.TixA$.value;
}
function FindA(){
doFindA=setInterval("calcA()",1);
}
function xcalcA(){
clearInterval(doFindA);
}

<input type=text name="ALabel" value="Adult" align=left>
<input type=text name="TixANum" align=right size="6" value="" onFocus="FindA();" onBlur="xcalcA();">
<input type=text name="TixA$" readonly="readonly" align=right size="10" value="15";>
<input type=text name="TixAOrd$" align=right size="6" readonly="readonly">
<br>

It all happens twice more--senior and student. I haven't been successful at totalling all the tickets or price yet, but I'm sure I'll get there eventually.

Anyway, question #1 is, is there some way to generically reference an input item so that I could use the same set of functions for all 3 calculations? In Access there is that Me! reference which is very helpful. I hope I'm making sense. What I want to do is pass the value I type in for the adult tickets up to some other variable and do the calculation from there. Then, when I go to the next line, say senior, I can pass that value up to the same variable and do the same calcultion again.

Question 2: Once I get that sorted out, I'm wondering how to pass this information into an Access database. Right now, I have a terrific database which allows me to take ticket orders, reserve seats, etc (for which I've received tremendous help from someone else at this site). I'd like people who want to buy tickets to be able to submit this form to me via email, and from there I would like to transfer the data to Access. This will take a bit of doing for me, but I'm wondering if this is workable. Already I've noticed that I cannot use the copy and paste to even put the data into Excel.

Any advice would be most appreciated.
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 03:26 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.