asp and how it works with javascript + select boxe

Results 1 to 2 of 2

Thread: asp and how it works with javascript + select boxe

  1. #1
    Join Date
    Dec 1969

    Default asp and how it works with javascript + select boxe

    I am new to ASP and Javascript and have been asked to develop a prototype site - I have had real trouble trying to read a variable pulled from the database - &#060;%=strProductPrice%&#062; (this is displayed from the database by looping through records) and I multiply this with a quantity selected by the User - Ideally I would like to do this through a pull-down list (ie select box)<BR><BR>I want the result to be written into a field named p_quantity in my table.<BR><BR>I have tried to write a CalculateTotal function in Javascript but cant get it to recognise the &#060;%=strProductPrice%&#062; variable- also I am having trouble even calling a function in the HTML part of the page - from the Javascript in the header of the asp file.<BR><BR>How do I make my asp variables understandable to Javascript and how do i call a function within an asp page?<BR><BR>I am not sure how javascript and asp communicate with each other - is it better to set up an html page with asp tags in it/ an asp page with html and javascript embedded within it.<BR><BR>Are there any resources you can recommend.<BR><BR>any suggestions on how to solve this? Should I use VBScript instead as I will want to start writing cookies from all this too.<BR><BR>shahira

  2. #2
    Join Date
    Dec 1969

    Default Time to read a book...

    We could give you the answers you need, but to do it right would take a couple of chapters of text. Hundreds or thousands of words.<BR><BR>The short answer, though, is given here:<BR><BR><BR><BR>Be sure to read the articles and other FAQs that this one links to.<BR><BR>(And the even shorter answer is: The browser can&#039;t "see" ASP variables and values. It can *ONLY* see what is sent to it via HTML. Period. Now, one of the things you *can* send to it *is* JavaScript code that is *written* by the ASP code.)<BR><BR>

Posting Permissions

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