473,383 Members | 1,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

JavaScript and ASP

Hi everybody, how r u? I hope fine...

People, I have a Javascript function wich returns true ou false, how do I
assign the result on ASP variable?

<% blnResult = javascript:function() %>

All these work because I have a form wich fields are verified by JavaScript
on the client...

Is that possible to do?
Sep 5 '06 #1
7 1401
Paulo Roberto wrote on 05 sep 2006 in
microsoft.public.inetserver.asp.general:
Hi everybody, how r u? I hope fine...
Please write normally this is usenet!
People, I have a Javascript function wich returns true ou false, how
do I assign the result on ASP variable?
I hope you mean serverside Javascript, as clientside Javascript
only executes when the serverside rendering has finisched.
<% blnResult = javascript:function() %>
<% 'supposing this ids the default vbscript
myResult = myJavascriptFunction()
%>
All these work because I have a form wich fields are verified by
JavaScript on the client...
So it is clientside Javascript?
Is that possible to do?
You will have to send that to the server by a <formconstruct,
[or Ajax technology]
because the serverside coding of the original page has ended long before.

Please read up on ASP.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Sep 5 '06 #2
Sorry Evertjan,

Hi everybody, how are you? I hope fine...

Resuming, what I need to know if is it possible to interchange ASP and
client JavaScript results.

Example: after the user has pressed submit form and the client JavaScript
has checked all fields I want the result being stored in a ASP variable, can
you understand?

thanks

"Evertjan." <ex**************@interxnl.netwrote in message
news:Xn********************@194.109.133.242...
Paulo Roberto wrote on 05 sep 2006 in
microsoft.public.inetserver.asp.general:
Hi everybody, how r u? I hope fine...

Please write normally this is usenet!
People, I have a Javascript function wich returns true ou false, how
do I assign the result on ASP variable?

I hope you mean serverside Javascript, as clientside Javascript
only executes when the serverside rendering has finisched.
<% blnResult = javascript:function() %>

<% 'supposing this ids the default vbscript
myResult = myJavascriptFunction()
%>
All these work because I have a form wich fields are verified by
JavaScript on the client...

So it is clientside Javascript?
Is that possible to do?

You will have to send that to the server by a <formconstruct,
[or Ajax technology]
because the serverside coding of the original page has ended long before.

Please read up on ASP.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Sep 5 '06 #3
Paulo Roberto wrote on 05 sep 2006 in
microsoft.public.inetserver.asp.general:
"Evertjan." <ex**************@interxnl.netwrote in message
news:Xn********************@194.109.133.242...
>Paulo Roberto wrote on 05 sep 2006 in
microsoft.public.inetserver.asp.general:
Hi everybody, how r u? I hope fine...

Please write normally this is usenet!
People, I have a Javascript function wich returns true ou false,
how do I assign the result on ASP variable?

I hope you mean serverside Javascript, as clientside Javascript
only executes when the serverside rendering has finisched.
<% blnResult = javascript:function() %>

<% 'supposing this ids the default vbscript
myResult = myJavascriptFunction()
%>
All these work because I have a form wich fields are verified by
JavaScript on the client...

So it is clientside Javascript?
Is that possible to do?

You will have to send that to the server by a <formconstruct,
[or Ajax technology]
because the serverside coding of the original page has ended long
before.

Please read up on ASP.
[please do not toppost on usenet]
Resuming, what I need to know if is it possible to interchange ASP and
client JavaScript results.

Example: after the user has pressed submit form and the client
JavaScript has checked all fields I want the result being stored in a
ASP variable, can you understand?
I can understand, and I even told you how to do it.
More extensive:

<form onsubmit='return checkFields()' action='receive.asp' method='post'>
<input name = 'field1'>
<input name = 'field2'>
<input name = 'field3'>
<input type='submit'>
</form>

where the clientside javascript function checkFields()
returns only true when the fields are OK.

==================

And in 'receive.asp':

<%
ValueOfField1 = request.form("field1")
ValueOfField2 = request.form("field2")
ValueOfField3 = request.form("field3")
%>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Sep 5 '06 #4
I know all that you said... Let me try a example:

In ASP a following code is valid:

<script language=Javascript>
(here comes the codes and we CAN mix asp together, like:)
int someJavaVarInt = <%=aspVariable %>
for i 1 to <%=aspVariableNumber %do
next
etc etc
</script>

BUT what I need is the INVERSE, just like:

<script language=Javascript>
function JavaScriptClient_Verify(){
...code that checks something and I would like to return TRUE to my asp
variable, something like:
if return(true) then{
<% aspVar = true%>
}
}
</script>

Because on the end of the page I need to execute instructions based on that
aspVariable...

Can you help me ?

"Evertjan." <ex**************@interxnl.netwrote in message
news:Xn********************@194.109.133.242...
Paulo Roberto wrote on 05 sep 2006 in
microsoft.public.inetserver.asp.general:
"Evertjan." <ex**************@interxnl.netwrote in message
news:Xn********************@194.109.133.242...
Paulo Roberto wrote on 05 sep 2006 in
microsoft.public.inetserver.asp.general:

Hi everybody, how r u? I hope fine...

Please write normally this is usenet!

People, I have a Javascript function wich returns true ou false,
how do I assign the result on ASP variable?

I hope you mean serverside Javascript, as clientside Javascript
only executes when the serverside rendering has finisched.

<% blnResult = javascript:function() %>

<% 'supposing this ids the default vbscript
myResult = myJavascriptFunction()
%>

All these work because I have a form wich fields are verified by
JavaScript on the client...

So it is clientside Javascript?

Is that possible to do?

You will have to send that to the server by a <formconstruct,
[or Ajax technology]
because the serverside coding of the original page has ended long
before.

Please read up on ASP.

[please do not toppost on usenet]
Resuming, what I need to know if is it possible to interchange ASP and
client JavaScript results.

Example: after the user has pressed submit form and the client
JavaScript has checked all fields I want the result being stored in a
ASP variable, can you understand?

I can understand, and I even told you how to do it.
More extensive:

<form onsubmit='return checkFields()' action='receive.asp' method='post'>
<input name = 'field1'>
<input name = 'field2'>
<input name = 'field3'>
<input type='submit'>
</form>

where the clientside javascript function checkFields()
returns only true when the fields are OK.

==================

And in 'receive.asp':

<%
ValueOfField1 = request.form("field1")
ValueOfField2 = request.form("field2")
ValueOfField3 = request.form("field3")
%>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Sep 5 '06 #5
"Paulo Roberto" <pa***********@edt.com.brwrote:
>Sorry Evertjan,

Hi everybody, how are you? I hope fine...

Resuming, what I need to know if is it possible to interchange ASP and
client JavaScript results.

Example: after the user has pressed submit form and the client JavaScript
has checked all fields I want the result being stored in a ASP variable, can
you understand?
Yes, I understand. No it can't be done.

Your ASP code executes on the server. The result is HTML, including
Javascript, which is sent to the client. Any client-side Javascript
executes there after the ASP code is finished.

You can use the Javascript to compute something, which is then
submitted in a form - possibly hidden, probably not - back to the
server.

--
Tim Slattery
MS MVP(DTS)
Sl********@bls.gov
Sep 5 '06 #6
Paulo Roberto wrote on 05 sep 2006 in
microsoft.public.inetserver.asp.general:
"Evertjan." <ex**************@interxnl.netwrote in message
>Paulo Roberto wrote on 05 sep 2006 in
[...]
>Please read up on ASP.

[please do not toppost on usenet]
Did you read that?
>>
Resuming, what I need to know if is it possible to interchange ASP
and client JavaScript results.

Example: after the user has pressed submit form and the client
JavaScript has checked all fields I want the result being stored in
a ASP variable, can you understand?

I can understand, and I even told you how to do it.
More extensive:

<form onsubmit='return checkFields()' action='receive.asp'
method='post'<input name = 'field1'>
<input name = 'field2'>
<input name = 'field3'>
<input type='submit'>
</form>

where the clientside javascript function checkFields()
returns only true when the fields are OK.

==================
And in 'receive.asp':
<%
ValueOfField1 = request.form("field1")
ValueOfField2 = request.form("field2")
ValueOfField3 = request.form("field3")
%>
[please please please please please
please please please please please please
please please please please please
do not toppost on usenet]
I know all that you said...
I do not think so ....
Let me try a example:

In ASP a following code is valid:

<script language=Javascript>
(here comes the codes and we CAN mix asp together, like:)
int someJavaVarInt = <%=aspVariable %>
for i 1 to <%=aspVariableNumber %do
next
etc etc
</script>
Not true, that is not in ASP,
the shown ASP-vbscript code is just used
to render the clientside javascript code!
and html and clientside code is not ASP.

The client/browser only receives the value!!!

Try is by view-source-ing your page on the browser.
BUT what I need is the INVERSE, just like:
[...]

Impossible, your reasoning is wrong.

Rain stops when conditions in the cloud change,
and the street gets dry,
but you cannot change the conditons in the cloud
by swapping up the rain from the street.

ASP renders a text stream that is sent as
HTML+clientsidecode to the client.
When the clientside code executes on the browser,
the rendering of the serverside ASP code
[usualliy in vbscript or also javascript]
is done and finished.
Because on the end of the page I need to
execute instructions based on that
aspVariable...
You cannot execute serverside(!!!) code based
on something that comes up clientside in the same page.

The client has to sent this to the server
and the server can only process this under ASP
in a newly called asp-file.

This can be done as shown twice using a <formsubmit,
[or with Ajax technology,
the latter being far to difficult for you,
if you do not understand the above.]

====

[Sorry, but if you keep on topposting I will not answer anymore.]

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Sep 5 '06 #7
Client side code runs on the client. ASP runs on the server. The only
way that values get passed between the two is in the Request/Response
cycle - meaning a round trip to the server.

In your first example, <%=aspVariable %>is assigned a value on the
server, so that by the time it reaches the client and the javascript is
executed, it is no longer ASP.

Your second example cannot work in the way you have set out. You will
need to perform a round trip to the server to assign a variable in ASP.
Consequently, you can't put a second lot of ASP at the end of the page
as you alluded to to execute later. It all gets executed at once. You
need to rethink your structure.

--
Mike Brind

Paulo Roberto wrote:
I know all that you said... Let me try a example:

In ASP a following code is valid:

<script language=Javascript>
(here comes the codes and we CAN mix asp together, like:)
int someJavaVarInt = <%=aspVariable %>
for i 1 to <%=aspVariableNumber %do
next
etc etc
</script>

BUT what I need is the INVERSE, just like:

<script language=Javascript>
function JavaScriptClient_Verify(){
...code that checks something and I would like to return TRUE to my asp
variable, something like:
if return(true) then{
<% aspVar = true%>
}
}
</script>

Because on the end of the page I need to execute instructions based on that
aspVariable...

Can you help me ?

"Evertjan." <ex**************@interxnl.netwrote in message
news:Xn********************@194.109.133.242...
Paulo Roberto wrote on 05 sep 2006 in
microsoft.public.inetserver.asp.general:
"Evertjan." <ex**************@interxnl.netwrote in message
news:Xn********************@194.109.133.242...
>Paulo Roberto wrote on 05 sep 2006 in
>microsoft.public.inetserver.asp.general:
>>
Hi everybody, how r u? I hope fine...
>>
>Please write normally this is usenet!
>>
People, I have a Javascript function wich returns true ou false,
how do I assign the result on ASP variable?
>>
>I hope you mean serverside Javascript, as clientside Javascript
>only executes when the serverside rendering has finisched.
>>
<% blnResult = javascript:function() %>
>>
><% 'supposing this ids the default vbscript
>myResult = myJavascriptFunction()
>%>
>>
All these work because I have a form wich fields are verified by
JavaScript on the client...
>>
>So it is clientside Javascript?
>>
Is that possible to do?
>>
>You will have to send that to the server by a <formconstruct,
>[or Ajax technology]
>because the serverside coding of the original page has ended long
>before.
>>
>Please read up on ASP.
[please do not toppost on usenet]
Resuming, what I need to know if is it possible to interchange ASP and
client JavaScript results.
>
Example: after the user has pressed submit form and the client
JavaScript has checked all fields I want the result being stored in a
ASP variable, can you understand?
I can understand, and I even told you how to do it.
More extensive:

<form onsubmit='return checkFields()' action='receive.asp' method='post'>
<input name = 'field1'>
<input name = 'field2'>
<input name = 'field3'>
<input type='submit'>
</form>

where the clientside javascript function checkFields()
returns only true when the fields are OK.

==================

And in 'receive.asp':

<%
ValueOfField1 = request.form("field1")
ValueOfField2 = request.form("field2")
ValueOfField3 = request.form("field3")
%>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Sep 5 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.