Doing Calculations in a css webpage using java

Hi
I run a small website for ex members of an RAF Squadron. We would like to offer items for sale on the site but do not want to go down the route of a shopping trolly scenario where by we have to deal with electronic cash payments. To this end I have done a small page that has a table. I would like to be able to present the prospective purchaser with a total cost at the end of thier shopping trip. I was wondering if anyone could help me with the code
i.e one field is quantity the other is total so the math is x*y simple, even this old grey hair cabn work that out but how do I make it look pretty on the site?
I have tried to do it using jbots in frontpage , but these don't seem to like the table structure
below is the portion of the page relating to the table. Apologies to the purists who know all the ins and outs, but I am just learning and rather late into the game.
<style type="text/css" media="screen">
.datatable {
     border: 1px solid #D6DDE6;
     border-collapse: collapse;
     width: 10%;
.datatable caption {
     color: #33517A;
     font: bold 1.2em Arial, Helvetica, sans-serif;
     padding-bottom: 8px;
     padding-top: 3px;
     text-align: left;
.datatable td {
     border: 1px solid #D6DDE6;
     padding: 4px;
.datatable th {
     background-color: #BCBCBC;
     border: 1px solid #828282;
     color: Navy;
     font: sans-serif;
     font-style: italic;
     text-align: center;
     font-weight: bold;
     padding-left: 4px;
.datatable tr.altrow {
     background-color: #FFFFBB;
     color: Navy;
     font: sans-serif;
     font-style: oblique;
     text-align: justify;
     font-weight: bold;
     padding-left: 4px;
</style>
</head><body>
<img src="images/sqnshop.jpg" style="margin-left: 10em;" />
<h1 style="color: #0002DD; text-align: center;">Welcome to the 202 Squadron Shop</h1>
<div id="side1">
<h3>Navigation</h3>
<ul>
     <li><a href="Home Page</li>
     <li><a href="Squadron History</li>
     <li><a href="Association Scrapbook</li>
     <li>The Line Book</li>
     <li>The Mucky Duck</li>
     <li>Members Directory</li>
     <li><a href="Requests For Assistance</li>
     <li><a href="Constitution & Committee</li>
<li>Links To Friends & Associates</li>
     </ul>     
     </div>
<div id="content">
<p style="text-align: center;">With the exception of any items marked "Squadron Only", these items are offered for sale to all visitors to the site.</p>
<p style="font-family: Verdana, Arial, sans-serif; font-size: 0.6em; color: Black;">Please Note: These items are offered by kind permission of the Officer Commanding 202 Squadron. The Squadron do not undertake on line payments. All transactions must be by a cheque for the correct amount in sterling and encashable at a UK bank. Goods will not be sent until confirmation that the cheque has cleared and the requisite funds are deposited in their account. There will be no relaxation of these rules</p>
     <form method="post" action="action="http://www/">
     <table summary="202 Squadron Shop Price List" class="datatable" style="font-family: Verdana, Arial, sans-serif; font-size: 1em; ">
          <tr>
          <th scope="col">Item</th>
          <th scope="col">Item Cost</th>
          <th scope="col">Qty Req'd</th>
          <th scope="col">Total Item Cost</th>
          </tr>
          <tr class="altrow" style="font-family: Verdana, Arial, sans-serif; font-size: 0.7em;">
          <td>Engraved Sqn Tankard</td><td>�16.00</td><td><span><label for="tankard"></label><input type="text" name="tankard" id="tankard" size="3" style="font-family: Arial; font-size: 1em; font-weight: bold" /></span></td><td><span><label for="tankcost"></label><input type="text" name="tankcost" id="tankcost" size="3" style="font-family: Arial; font-size: 1em; font-weight: bold" /></span></td></tr><tr class="altrow" style="font-family: Verdana, Arial, sans-serif; font-size: 0.7em;"><td>Squadron Tie</td><td>�6.00</td><td><span><label for="tie"></label><input type="text" name="tie" id="tie" size="3" style="font-family: Arial; font-size: 1em; font-weight: bold" /></span></td>
     <td><span><label for="tiecost"></label><input type="text" name="tiecost" id="tiecost" size="3" style="font-family: Arial; font-size: 1em; font-weight: bold" /></span></td></tr>
     <tr class="altrow" style="font-family: Verdana, Arial, sans-serif; font-size: 0.7em;"><td>Sqn Plaque</td><td>�21.00</td><td><span><label for="plaque"></label><input type="text" name="plaque" id="plaque" size="3" style="font-family: Arial; font-size: 1em; font-weight: bold" /></span></td><td><span><label for="plaquecost"></label><input type="text" name="plaquecost" id="plaquecost" size="3" style="font-family: Arial; font-size: 1em; font-weight: bold" /></span></td></tr>
     <tr class="altrow" style="font-family: Verdana, Arial, sans-serif; font-size: 0.7em;"><td>Squadron Cummerbund</td><td>�20.00</td><td><span><label for="cummerb"></label><input type="text" name="cummerb" id="cummerb" size="3" style="font-family: Arial; font-size: 1em; font-weight: bold" /></span></td>
     <td><span><label for="cummerbcost"></label><input type="text" name="cummerbcost" id="cummerbcost" size="3" style="font-family: Arial; font-size: 1em; font-weight: bold" /></span></td></tr><tr class="altrow" style="font-family: Verdana, Arial, sans-serif; font-size: 0.7em;"><td>Sqn Print</td><td>�7.50</td>
     <td><span><label for="sqnprint"></label><input type="text" name="sqnprint" id="sqnprint" size="3" style="font-family: Arial; font-size: 1em; font-weight: bold" /></span></td>
     <td><span><label for="printcost"></label><input type="text" name="printcost" id="printcost" size="3" style="font-family: Arial; font-size: 1em; font-weight: bold" /></span></td></tr>
     <tr class="altrow" style="font-family: Verdana, Arial, sans-serif; font-size: 0.7em;"><td>Squadron Cufflinks</td><td>�6.00</td><td><span><label for="cufflinks"></label><input type="text" name="cufflinks" id="cufflinks" size="3" style="font-family: Arial; font-size: 1em; font-weight: bold" /></span></td>
     <td><span><label for="cuffcosts"></label><input type="text" name="cuffcost" id="cuffcost" size="3" style="font-family: Arial; font-size: 1em; font-weight: bold" /></span></td></tr><tr class="altrow" style="font-family: Verdana, Arial, sans-serif; font-size: 0.7em;"><td>Squadron Tiepins</td><td>�4.00</td>
     <td><span><label for="tiepins"></label><input type="text" name="tiepins" id="tiepins" size="3" style="font-family: Arial; font-size: 1em; font-weight: bold" /></span></td>
     <td><span><label for="tiepincosts"></label><input type="text" name="tiepincosts" id="tiepincosts" size="3" style="font-family: Arial; font-size: 1em; font-weight: bold" /></span></td></tr>
     <tr class="altrow" style="font-family: Verdana, Arial, sans-serif; font-size: 0.7em;"><td>Bookmark (Photo & Sqn history)</td><td>�1.00</td><td><span><label for="bookmark"></label><input type="text" name="bookmark" id="bookmark" size="3" style="font-family: Arial; font-size: 1em; font-weight: bold" /></span></td><td><span><label for="bookmarkcosts"></label><input type="text" name="bookmarkcosts" id="bookmarkcosts" size="3" style="font-family: Arial; font-size: 1em; font-weight: bold" /></span></td></tr>
     <tr class="altrow" style="font-family: Verdana, Arial, sans-serif; font-size: 0.7em;"><td>Sea King Postcard</td><td>�0.25</td><td><span><label for="postcard"></label><input type="text" name="postcard" id="postcard" size="3" style="font-family: Arial; font-size: 1em; font-weight: bold" /></span></td><td><span><label for="postcardcosts"></label><input type="text" name="postcardcosts" id="postcardcosts" size="3" style="font-family: Arial; font-size: 1em; font-weight: bold" /></span></td></tr>
     <tr class="altrow" style="font-family: Verdana, Arial, sans-serif; font-size: 0.7em;">
     <td>Total Unit Cost</td><td></td><td></td><td><span><label for="totalcostscosts"></label><input type="text" name="totalcosts" id="totalcosts" size="3" style="font-family: Arial; font-size: 1em; font-weight: bold" /></span>
     </td></tr><tr class="altrow" style="font-family: Verdana, Arial, sans-serif; font-size: 0.7em;"><td>Postage & Packing</td><td></td><td></td>
     <td><span><label for="postandpack"></label><input type="text" name="postandpack" id="postandpack" size="3" style="font-family: Arial; font-size: 1em; font-weight: bold" /></span></td></tr><tr class="altrow" style="font-family: Verdana, Arial, sans-serif; font-size: 0.7em;"><td>Amount Due</td><td></td><td></td><td><span><label for="amount_due"></label><input type="text" name="amount_due" id="amount_due" size="3" style="font-family: Arial; font-size: 1em; font-weight: bold" /></span></td></tr>
     <p><label for="Forename">Please enter your first name: </label><input type="text" name="Forename" id="Forename" size="25" style="font-family: Verdana,Arial,sans-serif; font-size: 0.8em; font-weight: bold;" /><br /></p>
     <p><label for="Surname">Please enter your surname: </label><input type="text" name="surname" id="surname" size="25" style="font-family: Verdana,Arial,sans-serif; font-size: 0.8em; font-weight: bold" /></p>
     <p><label for="email_address">Please enter your e-mail address: </label><input type="text" name="email" id="email_address" size="80" style="font-family: Verdana,Arial,sans-serif; font-size: 0.8em; font-weight: bold" /></p>
     <input type="hidden" name="subject" value="202 Squadron Giftshop Order" />
     <input type="hidden" name="required" value="email,surname " />
     <input type="hidden" name="redirect" value="http://www" />
     <input class="green" type="submit" value="Send Order"/> <input class="red" type="reset" value="Cancel Order"/>
     </form>
     </div>
<div id="side2">
<h3></h3>
</div>
</body>
</html>
Any suggestions will be gratefully received
Cheers
Mike

Seems to me your question is about Javascript. At least, that is how you would get calculations done in a web page (CSS has nothing to do with that). However this forum is about Java, which is a completely different language.
You'll find a Javascript forum here:
http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi

Similar Messages

  • How to  build a  Calculator in WAB Template  by using  Java Script......

    Hi ,
    I am  trying   to build a dynamic  calculator in WAD which is as  similar to one in Executive view in Cognos. The  problem i am  facing  is,  i can  able to build a normal  calculator  by using  java script  but  i am  unable  to read the  key figure  values from  the  analysis  item  on from the  data  provider  in to  by  calculator  by using  on click  function. I wanted  to get the all  the  values in to a internal excel , so  that  my calculator can read the  values from  that. can  any  one  help  me  on getting  values in to internal excel by using   java before the  executing the  web template ?...
    Thanks in advance....
    Jhon.
    Edited by: sap bw on Jul 31, 2008 5:51 PM
    Edited by: sap bw on Jul 31, 2008 5:52 PM

    I might not be understanding your question completely since you mention WAD and then Excel, but if you are asking how to get the key figure values using Javascript in WAD, you can go to the Dataprovider properties and enable 'Output Result Data'.  This will embed an XML element into the HTML output that you can then parse using standard Javascript DOM navigation.
    Hope this helps.

  • Open a webpage using Java

    Hi,
    I am trying to open a webpage in a browser using Java code. I have been reading the tutorials and came across some code that reads the webpage as a simple text using getPageContent etc. I don't need to read the page, I just need to open it.
    Can anyone please guide me, tell me which docs I should refer to etc.
    Thanks,
    M

    import java.awt.Desktop; //Java 1.6
    import java.io.IOException;
    import java.net.URI;
    import java.net.URISyntaxException;
    public class BrowseExample {
        public static void main(String[] args) throws IOException, URISyntaxException {
            URI uri = new URI("http://java.sun.com");
            Desktop.getDesktop().browse(uri);
    }

  • Upgrade to 18.0 has disabled Java even though plugin checker says Java 7 Update 10 is up to date, yet webpages using java display "missing plug in" error

    Attempting to install the "missing plug-in" using the Firefox prompts results in Java 7 Update 10 being installed, re-installing it is successful and does not resolve the issue, Firefox 18 refuses to allow/display java content even with the proper updated version of Java installed.
    This problem ONLY occurred immediately following this mornings update to Firefox 18.0.

    Context:
    Yesterday: Java working fine.
    This morning: Update to Firefox 18.0
    Java will not work, not at all even with Java 7 Update 10 installed, not even the "verify java version" applet at http://www.java.com/en/download/installed.jsp will display.
    When attempting to view/display any java content the "missing plug-in" error bar at the top of the page displays and attempting to install the required plug-in via that method does not resolve the issue even though the correct version of Java is installed and the plug-in checker verified it was "up-to-date".

  • XSLT Mapping : RFC Lookup using java helper class

    Hi All,
    I am doing RFC Lookup in xslt mapping using java helper class. I have found blog for the same (http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/05a3d62e-0a01-0010-14bc-adc8efd4ee14) However this blog is very advanced.
    Can anybody help me with step by step approach for the same?
    My basic questions are not answered in the blog as:
    1) where to add the jar file of the java class used in xslt mapping.
    I have added zip file of XSLT mapping in imported archived and using that in mapping.
    Thanks in advace.
    Regards,
    Rohan

    Hi,
    Can u please have look at this in detail , u can easily point out yourself the problem...
    http://help.sap.com/saphelp_nw04/helpdata/en/55/7ef3003fc411d6b1f700508b5d5211/content.htm
    Please observe the line,
    xmlns:javamap="java:com.company.group.MappingClass
    in XSLT mapping..
    The packagename of class and class name and XSLT namespace should be matching...
    Babu
    Edited by: hlbabu123 on Sep 29, 2010 6:04 PM

  • Mac OS X Copying JavaApplicationStub using Java code

    I have a java application that copies files from one folder to another.
    This works fine on Windows, but on Mac OS X a Unix executable file like JavaApplicationStub appearently does not like to be copied using Java...
    I have tested the application trying to duplicate a whole MyApplication.app package.
    I realize that the file system is somewhat different on Mac than Windows, but I have a hard time accepting that java should not be able to copy a unix executable file from one folder to another without damaging the file...?
    The copied file has the same size, but the file info does not say "Unix executable file" but "Document".
    If I double-click it, it is opened using Terminal, but all it says is "Welcome to Darwin"
    If I double-click the original file, (in the original package) the embedded java application is launched...
    Can anyone give me a piece of Java code that successfully copies (duplicates) a Unix executable file?
    Or a hint....?
    Thanks, I would be VERY grateful :)

    I am using something like:
    byte[] buf;
    BufferedInputStream bis;
    BufferedOutputStream bos;
    int bytesRead;
    int fileSize;
    fileSize = (int)sourceFile.length();
    buf = new byte[512];
    bis = new BufferedInputStream(new FileInputStream(sourceFile));
    bos = new BufferedOutputStream(new FileOutputStream(destFile));
    while ((bytesRead = bis.read(buf)) > -1) {
    bos.write(buf, 0, bytesRead);
    bis.close();
    bos.close();

  • How to open Word Document using java?

    Respected Sir/ Madam,
    I am doing my project in Network Security using java. I have to transfer the files from server to the client. Each transferred file should have some of the access privileges such as read, write and exeucte. If the transferred file is a word document means then automatically the client should open Microsoft word and if the file is having Read Permission alone then the save, Save As, cut,copy, paste options in the MS - Word should be disabled. This is similar for all the files that i have transferred. That is if the transferred file is excel, audio, video,txt file the corresponding application should be opened properly. How could I acheive this. If the file is having write permission then if the user clicks the save option then the contents of the file should be saved in the server machine not in the client machine, Could we achieve this???? Can anyone help me regarding this? Please give me your views about this query?

    Respected Sir / Madam,
    Thank you very much for your reply. Could we use Microsoft API inside java program to achieve my doubts?? Could U explain it more????

  • Read IDOC using java language

    Hi,
       I am a new to sap java develop.
      now i am doing some research about IDOC/ALE using java language. I  receive an IDOC file from the sap system ,now i want to read the data in the IDOC file and tranform it to an XML file. Is there anyway to do it? whether java have provided some Kits to finish it.
       thanks in advance.
        qiuguo

    Hi
    Please refer to
    1. idoc
    3. how to create a simple idoc in practice? can you provide an example?
    Regards
    Abhijith YS

  • Java does not work at all upon using the update manager to update to firefox 3.6.10 for Ubuntu 9.0.4

    OS: Ubuntu 9.0.4
    Browser: Firefox 3.6.10
    upon updating to firefox 3.6.10, java does not work at all.
    websites that use java do not work at all anymore, when they worked just fine before the updating thru update manager. e.g. hulu website cannot play any of the shows.
    i can give the folder of bookmarked pages i tried.
    how to do that on here, i've yet to see if possible.
    i can even give saved text from the terminal concerning certain attempts.
    when i updated thru update manager, it gave some weird java plugin that wasn't there before "The IcedTea Web Browser Plugin IcedTea6 Java Web Browser Plugin (execution of applets on webpages)".
    i uninstalled this as instructed by an answer found in one of the pages i saved, cuz it was conflicting w/another java program the updater said i needed. right now, i don't remember for sure what it was. it perhaps was realplayer flash or Java itself. w/all the hours/days of searching i put in, it's difficult if not downright impossible for me to remember all the specifics of what i tried.
    i've searched throughout many webpages (including many searches on mozilla, ubuntu, java, etc) for instruction in fixing the problem.
    oh, and incidentally, on the Java site, when i try the verify test of Java, firefox pops up with that yellow bar right below the slew of tabbed website windows, giving the statement "additional plugins are required to display all the media on this page. (w/link to) install missing plugins ." which is what i do, go thru the requesting plugin installation. it comes up with, guess what, the IcedTea Java Plugin. i click on the 'next' in the "Plugin Finder Service" box that pops up, & all it gives me is "No plugins were installed. IcedTea ...Plugin failed. and the link 'find out more about plugins or manually find missing plugins'". the link takes me to some of the very things/plugins that wouldn't install in the first place. the Java test failure is a LOL funny, as what plugin it is saying is required (IcedTea) is a recommended alternate program to display the very test in the first place.
    i followed the given instructions on those many searched pages, in every case (barring what i may have just plain missed), but to no avail.
    i've even gone to the point of trying to reinstall the previous 3.5.13 firefox version, from mozilla site. even that wouldn't install.
    i've tried installing Java for my sys direct from it's site. nada.
    now it's time for me to post the problem & perhaps someone will come up with some kind of "dummy" way to fix it.
    until then many sites a regularly use are totally useless to me on this fast puter.
    the only way i can get to use such sites, are two choices: 1. use a dinosaur laptop, which is slower than molasses & cannot handle to any streaming stuff, or 2. use an available internet access puter at the library. but useage for ea person per day is limited to only one hour a day. and one can end up waiting for an hour or more ( in the busiest periods) to even get to use one.
    so, is there anyone at all, who knows any for-sure working fix for this problem?
    thanks muchly :^D
    p.s. i can't pay anybody any money for such help, as is required in certain sites (e.g. Java website), cuz i don't have any.
    i can pay in labor tho, if there is someway to find someone who can physically be at this puter w/me, taking me step-by-step
    sorry for the 20-pg essay. i hope it was all clearly understood. if, not, well, clear communication is always what is needed, ask away.

    Your above posted system details show outdated plugin(s) with known security and stability risks.
    *Shockwave Flash 9.0 r999
    Update the [[Managing the Flash plugin|Flash]] plugin to the latest version.
    *http://www.adobe.com/software/flash/about/
    In Firefox 3.6 and later versions you need the Next-Generation Java™ Plug-In present in Java 6 U10 and later (Linux: libnpjp2.so; Windows: npjp2.dll).
    http://java.com/en/download/faq/firefox_newplugin.xml
    See also http://java.sun.com/javase/6/webnotes/install/jre/manual-plugin-install-linux.html

  • How does one know whether or not they use "Java applets"?

    The support doc for the recent Java update (Update 8, for Snow Leopard), entitled "About Java for Mac OS X 10.6 Update 8," advises the following:
    If you do not use Java applets, it is recommended that you disable the Java web plug-in in your web browser.
    How does one know whether or not they use "Java applets"?
    Thanks.
    URL:  http://support.apple.com/kb/HT5243

    K.S. wrote:
    dymar wrote:
    Also, how would I know that a missing applet was causing some feature(s) not to work in a situation where no error mesage was returned?
    Sometimes you have to dig to find out: http://earthnow.usgs.gov/earthnow_app.html
    doesn't tell you directly, but it is mentioned in the FAQ that Java is required. If the content is appropriate, you can always ask here.
    Thanks.  According to that webpage, my "Java is out of date."  When an error message like that is returned, I guess it's clear that "it's a Java problem."  Presumably, one would then just go to java.com and download the applet if he/she wanted to view the webpage.
    I was wondering more about situation when unexplained problems that involved missing Java applets weren't noted in error messages.
    But maybe I'm worrying about something that doesn't really need to be worried about.

  • HT1338 I need to bulk upload to Auctiva (auction software) but Java was disabled on my computer. I have 10.5.8 so does this mean that I can't use Java? If not, then is there a workaround to be able to use the bulk uploader from Auctiva?

    I need to bulk upload images from iPhoto to Auctiva (auction software) that will then be posted to eBay; however Java was disabled on my computer some time ago due to "known issues."  I have 10.5.8 so does this mean that I can't use Java? If not, then is there a workaround to be able to use the bulk uploader from Auctiva? As it stands now, I have to upload photos individually which is super time consuming.

    You can re-enable it for special purposes, opposite of disabling it...
    Disable Java in your Browser settings, not JavaScript.
    http://support.apple.com/kb/HT5241?viewlocale=en_US
    http://support.google.com/chrome/bin/answer.py?hl=en-GB&answer=142064
    http://support.mozilla.org/en-US/kb/How%20to%20turn%20off%20Java%20applets

  • Access database using Java from HTML webpage

    Hi,
    I've got to create some online maths tests to be taken by students with their marks being stored in a database.
    I've wrote some simple java code which can add/remove and modify entries in a test mySQL database that I made. What I now need to do is be able to add entries to the database from a html page.
    The math tests will be java applets with the students having to interact according to questions, press submit and their score will be output. The score will then be entered into the database.
    The problem I'm having is that with an Applet their are all sorts of security issues (I'm having problems getting images to load in an Applet) so assume I'll face the same security issues when I try to access a database through an applet.
    So, could someone please help get started.
    Cheers

    MVC - I assume you mean model-view-control and not Marvel vs Capcom :)
    If so then does this mean I should completely seperate the user interface (the actual applets that will contain the test), the database (that will store the results) and the link between the two?
    is it possible to acheive this using Java, Java Applets, Java Script and the database (in my case mySQL) and could you give me some tips on how best to tackle the problem.
    Thanks

  • Jaxa xml tutorials, does anyone have some tutorial for using xml in java??

    jaxa xml tutorials, does anyone have some tutorial for using xml in java??
    can be dom,sax,jaxp whatever....
    i try to find in google but din't find any complete one....

    dapim wrote:
    jaxa xml tutorials, does anyone have some tutorial for using xml in java??
    can be dom,sax,jaxp whatever....
    i try to find in google but din't find any complete one....I would imagine anyone here would just produce the same set of hits that you did, so why waste our time doing it only to direct you to the same one(s) you already found and rejected.

  • Applet does not load using java 1.5 through reverse proxy with certific...

    Hi,
    we have the following problem:
    When using java 1.5 in our browser, our applet does not load. Using java 1.4.2 it works. It also works using java 1.5.0 using another reverse proxy.
    The differences between the 2 reverse proxies (one works, one works not) we use is that the one through which the applet does not load has a certificate installed that is not for its hostname. Can this be the reason the applet does not load? Where can I find information about the sandbox of java 1.5.0 concerning these issues. Are there any docs of the security restrictions imposed by java 1.5.0 sandbox?
    Greetings,
    Tim

    Ok,
    the solution to this specific problem was a misconfigured reverse dns lookup.
    Greets,
    Tim

  • Does Firefox for Android use Java?

    Does it use Java? If so, how can Java be disabled or uninstalled?

    Oracle doe not make the Java plug-in for Android due to Oracle's lawsuit against Google which of course is the developer of Android.

Maybe you are looking for