Javascript vs vbscript

Results 1 to 3 of 3

Thread: Javascript vs vbscript

  1. #1
    subhendu Guest

    Default Javascript vs vbscript

    I want to update a text field (by multiplying two parameters)<BR>dynamically depending on the list box selection.This list box option value is one parameter on the same page and the other one ,I am getting from the previous page.How to get the functionality?Only help will be appreciated.<BR>regards<BR>S

  2. #2
    VeeMan Guest

    Default RE: Javascript vs vbscript

    If I understand correctly...Why don&#039t you try a hidden field for the parameter from the previous page...And...Then from the onFocus event of the current page&#039s next control after listbox...Call a function and pass it three parameters...Two being the values you need...Third being the name of the the form element for the result...Calculate and set the value...<BR><BR>I&#039ll presume you know you to mainpulate hidden form elements.<BR><BR>From the form element:<BR><BR>&#060;SELECT size=2 id=select1 name=select1 onFocus(calculateValue(Request.Form("hiddenField") ) , Request.Form("select1") , "FormCalculatedElementName") language="javascript"&#062;<BR><BR>NOTE: My JavaScript syntax is shaky at best...So this is not debugged...You gods out there...PLEASE don&#039t flame me...HeHe...<BR><BR>function calculateValue(firstValue , secondValue , elementName)<BR>{<BR><BR>var result = New Int;<BR><BR>result = Integer.parseInt(firstValue) * Integer.parseInt(secondValue);<BR><BR>elementName. value = result.toString();<BR>elementName.focus();<BR>elem;<BR><BR>return true;<BR><BR>}<BR><BR>Other than my JavaScript code...I think this will work...Hope helps...<BR><BR>VeeMan

  3. #3
    Join Date
    Dec 1969
    Los Angeles, CA

    Default RE: Javascript vs vbscript

    Just incase you will be supporting multi-browsers you will have to get the value from the combo in 2 diff ways one for NN and the other for ie. frm.elementname.value will not work for nn.

Posting Permissions

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