Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Oct 2010
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Sending info from java in HTML to a separate java class

    Hi All

    I'm hoping that someone can help me with this problem.

    I have made a java program which basically makes some calculations, plots a graph of the results and saves this as a jpeg.

    I have also made an html form with various dropdown menus and text boxes in which a user can enter their information. I want them to be able to click a 'calculate' button, which will send the information they have entered into the java application. The java will then make the required calculations, and the output graph should be displayed back on the html page so that the user can see their results. Hope this makes sense.

    I know the relevant javascript to take the values from the html form and assign this to variables in javascript, but I dont know how to send this over to another java class to make the required calculations.

    I have tried the following in the html:

    Code:
        	CalcClass Class2Object = new CalcClass();
    	
        	Class2Object.Calculate(temp);
    This seems to work when I am sending variable between two java classes in pure java, but not when half of the java is embedded in the html header.

    Any ideas where I might be going wrong?

    The html and class files are saved in the same folder so that shouldn't be an issue should it?

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,310
    Thanks
    203
    Thanked 2,563 Times in 2,541 Posts
    This is the JavaScript forum. Java and Javascript are entirely different programming languages, in spite of the confusingly similar names. Ask a mod to move you over.

    Java executes on the server; JavaScript on the client. There can be no interaction.


    It is your responsibility to die() if necessary….. - PHP Manual


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •