updating forms using ASP

updating forms using ASP

am 11.06.2007 18:00:51 von Roo

Hi - apologies for ASP newbie question.

I have a form which has two fields, "details" and "score", the first
of which can be edited by the user and the second of which is hidden.
When "details" is updated, I need to update "score" and then call a
javascript routine to do some client-side calculations using "score".

I was going to use ASP to search a text file containing the
corresponding values (there are thousands) of "details" and "score",
and then return a value into the hidden "score" field in my form.

e.g.


Details: onchange="docalculation()">






Not sure how to call the ASP routine though and get it to return a new
value of score. Don't want to refresh the page and need the score to
automatically update whenever the details field is changed.

Thanks

Roo

Re: updating forms using ASP

am 11.06.2007 18:18:17 von Tim Slattery

Roo wrote:

>Hi - apologies for ASP newbie question.
>
>I have a form which has two fields, "details" and "score", the first
>of which can be edited by the user and the second of which is hidden.
>When "details" is updated, I need to update "score" and then call a
>javascript routine to do some client-side calculations using "score".
>
>I was going to use ASP to search a text file containing the
>corresponding values (there are thousands) of "details" and "score",
>and then return a value into the hidden "score" field in my form.
>
>e.g.
>
>


>Details: >onchange="docalculation()">
>
>

>
>
>
>
>Not sure how to call the ASP routine though and get it to return a new
>value of score. Don't want to refresh the page and need the score to
>automatically update whenever the details field is changed.

ASP runs on the server and generates an HTML page that's delivered to
the client. JavaScript (usually, and definitely in this case) runs on
the client after the ASP processing is finished. So you cannot call an
ASP routine from Javascript code, except by have the Javascript submit
the page or send an AJAX request to the server. You'll have to do one
of those two things to accomplish what you want.

--
Tim Slattery
MS MVP(DTS)
Slattery_T@bls.gov
http://members.cox.net/slatteryt

Re: updating forms using ASP

am 11.06.2007 18:20:43 von Jon Paal

ASP runs on the server. If you want it to do something you must submit the page (refresh)

Alternatively, you could look into something like Ajax which pauses the page while it submits behind the scenes

http://en.wikipedia.org/wiki/Ajax_(programming)


"Roo" wrote in message news:1181577651.858055.72620@a26g2000pre.googlegroups.com...
> Hi - apologies for ASP newbie question.
>
> I have a form which has two fields, "details" and "score", the first
> of which can be edited by the user and the second of which is hidden.
> When "details" is updated, I need to update "score" and then call a
> javascript routine to do some client-side calculations using "score".
>
> I was going to use ASP to search a text file containing the
> corresponding values (there are thousands) of "details" and "score",
> and then return a value into the hidden "score" field in my form.
>
> e.g.
>
>


> Details: > onchange="docalculation()">
>
>

>
>
>
>
> Not sure how to call the ASP routine though and get it to return a new
> value of score. Don't want to refresh the page and need the score to
> automatically update whenever the details field is changed.
>
> Thanks
>
> Roo
>