#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Posts
    2
    Rep Power
    0

    Question Capture/save user variables using 'onclick'


    Hi there - can someone help me capture data when a user hits the button below? ie. can I have two actions on an 'onclick', or do I need to add something to the function?

    Attached: function, onclick statement and URL Appreciate your help.

    function pwave_calc(GeoForm)
    {
    var pwavelamda = GeoForm.lamda.value;
    var pwavemu = GeoForm.mu.value;
    var pwaverho = GeoForm.rho.value;

    if (pwaverho > 0)
    {
    GeoForm.pwave.value = Math.sqrt ( (pwavelamda + 2 * pwavemu) / pwaverho ) ;
    }
    else
    {
    GeoForm.pwave.value = "";
    }
    }

    ONCLICK Statement:

    <input type=BUTTON onClick="pwave_calc(this.form);" value="calculate" name="BUTTON">

    URL:
    http://www.geodictionary.com/htm/geo...rac_reflec.htm

    Thanks
  2. #2
  3. No Profile Picture
    Clueless llama
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Feb 2001
    Location
    Lincoln, NE. USA
    Posts
    2,353
    Rep Power
    117
    You want the javascript/html forum

IMN logo majestic logo threadwatch logo seochat tools logo