Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Custom formula with form input

  1. #1
    Junior Member
    Join Date
    Nov 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Custom formula with form input

    Hi.

    I need to create a HTML form which has one input field.

    once submit is clicked an automatic output needs to be displayed. the formula is essentially '(input * 12) /7'

    i am quite new to both HTML and Java so was wondering if anyone knew any simple code to do this?

    Many thanks, Ian


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: Custom formula with form input

    Are you trying to do this in Java or JavaScript? Note that they are not the same. If Java, refer to the Oracle tutorials for JApplets.

  3. #3
    Junior Member
    Join Date
    Nov 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Custom formula with form input

    ah.

    That could be a good question.

    Javascript....

    i could not find anything on the internet to do this.... and im quite new to it all.

    Many thanks.

  4. #4
    Member
    Join Date
    Oct 2013
    Location
    Saint-Petersburg, Russia
    Posts
    33
    Thanks
    0
    Thanked 5 Times in 5 Posts

    Default Re: Custom formula with form input

    Well, you'd better try to learn how to use internet search properly. This forum is not well suitable for your question since it is about very different language at all.

    In javascript you can simply call function "eval" for your string with math expression to get its result. Quite strange you failed to find this.

Similar Threads

  1. Heron's Formula
    By guneet.oct10@gmail.com in forum What's Wrong With My Code?
    Replies: 3
    Last Post: February 6th, 2013, 08:24 AM
  2. [SOLVED] Putting Trajectory of a Projectile formula in Java form.
    By mwebb in forum Java Theory & Questions
    Replies: 2
    Last Post: March 2nd, 2012, 07:23 PM
  3. Method is not initiating formula
    By CrimsonFlash in forum What's Wrong With My Code?
    Replies: 2
    Last Post: October 22nd, 2011, 08:19 PM
  4. how to get value path file from jsp form- input type file
    By meeGoreng in forum JavaServer Pages: JSP & JSTL
    Replies: 4
    Last Post: October 4th, 2011, 12:05 AM
  5. Java Swing :Back Button from one form to another form
    By srinivasan_253642 in forum AWT / Java Swing
    Replies: 1
    Last Post: December 26th, 2009, 09:51 AM