472,794 Members | 2,192 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

asp/javascript question

Hi guys,

Sorry about the off topic, but I can't find the ASP group just the ASP
dot NET

If I want to block a user to change a form after submiting, I add a
function that will disable the submit button, but when I'm getting the form
collection (using post or get (form/querystring) I can't retrieve that
button value...
Is there any trick to do this?

Like https://www.cuworld.com/ webpage... Try to register as a free user
membership and after click the submit button check what hapend... They
disable all the form (checking the source code, they disable every form
input box) How can they retrieve the values if the form is disable?
<script language="javascript" type="text/javascript">
function submitOrder() {
var count = order_form.all.length;
for ( var i = 0 ; i < count; i++ ) {
try {
order_form.all[i].disabled = true;
}
catch (ignore) { }
}
}
</script>

All help is apreciate, and once again, I'm sorry about the offf topic,
this is pure ASP and the group is for ASP.NET...

--

Bruno Alexandre
(Sintra, PORTUGAL)

Nov 18 '05 #1
7 1809
microsoft.public.inetserver.asp.*

Curt

"Bruno Alexandre" <br***@filtrarte.com> wrote in message
news:eM**************@TK2MSFTNGP12.phx.gbl...
Hi guys,

Sorry about the off topic, but I can't find the ASP group just the ASP
dot NET

If I want to block a user to change a form after submiting, I add a
function that will disable the submit button, but when I'm getting the
form
collection (using post or get (form/querystring) I can't retrieve that
button value...
Is there any trick to do this?

Like https://www.cuworld.com/ webpage... Try to register as a free user
membership and after click the submit button check what hapend... They
disable all the form (checking the source code, they disable every form
input box) How can they retrieve the values if the form is disable?
<script language="javascript" type="text/javascript">
function submitOrder() {
var count = order_form.all.length;
for ( var i = 0 ; i < count; i++ ) {
try {
order_form.all[i].disabled = true;
}
catch (ignore) { }
}
}
</script>

All help is apreciate, and once again, I'm sorry about the offf topic,
this is pure ASP and the group is for ASP.NET...

--

Bruno Alexandre
(Sintra, PORTUGAL)


Nov 18 '05 #2
A couple of quick things here:

The form can be disabled to the end user, but the form's control values can
still be accessed via code (Request.Form / Request.QueryString).

A button's value is retrieved just like any other form element:
Request.Form("buttonID") or Request.QueryString("buttonID")

I've modified your code a little, removing the "all" qualifier (this is not
supported in NetScape) and instead use the form array's "elements" array.
<script language="javascript" type="text/javascript">
function submitOrder() {
var formStuff = order_form.elements
var count = formStuff .length
for ( var i = 0 ; i < count; i++ )
{
try
{
formStuff [i].disabled = true
}
catch (ignore) { }
}
}
</script>
"Bruno Alexandre" <br***@filtrarte.com> wrote in message
news:eM**************@TK2MSFTNGP12.phx.gbl...
Hi guys,

Sorry about the off topic, but I can't find the ASP group just the ASP
dot NET

If I want to block a user to change a form after submiting, I add a
function that will disable the submit button, but when I'm getting the
form
collection (using post or get (form/querystring) I can't retrieve that
button value...
Is there any trick to do this?

Like https://www.cuworld.com/ webpage... Try to register as a free user
membership and after click the submit button check what hapend... They
disable all the form (checking the source code, they disable every form
input box) How can they retrieve the values if the form is disable?
<script language="javascript" type="text/javascript">
function submitOrder() {
var count = order_form.all.length;
for ( var i = 0 ; i < count; i++ ) {
try {
order_form.all[i].disabled = true;
}
catch (ignore) { }
}
}
</script>

All help is apreciate, and once again, I'm sorry about the offf topic,
this is pure ASP and the group is for ASP.NET...

--

Bruno Alexandre
(Sintra, PORTUGAL)


Nov 18 '05 #3
But I have in the page:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
response.Write("- - - - - - - - - - - - - - - - -<br>")
for each item in request.Form
response.Write( item & ": " & request.Form( item ) & "<br>" )
next
response.Write("- - - - - - - - - - - - - - - - -<br>")
for each item in request.QueryString
response.Write( item & ": " & request.QueryString( item ) & "<br>" )
next
response.Write("- - - - - - - - - - - - - - - - -<br>")
%>

and I can't have nothing... not even a single bit, just the dotted line...
:(
so, how can you retrive the values?

the form is:

<form name="order_form" method="get" action=""
onSubmit="return(submitOrder());">

and I tried with

<form name="order_form" method="post" action=""
onSubmit="return(submitOrder());">

the page is in : http://208.21.165.173/portal/asp/test.asp
--

Bruno Alexandre
(Sintra, PORTUGAL)

"Scott M." <s-***@nospam.nospam> escreveu na mensagem
news:u4**************@tk2msftngp13.phx.gbl...
A couple of quick things here:

The form can be disabled to the end user, but the form's control values can still be accessed via code (Request.Form / Request.QueryString).

A button's value is retrieved just like any other form element:
Request.Form("buttonID") or Request.QueryString("buttonID")

I've modified your code a little, removing the "all" qualifier (this is not supported in NetScape) and instead use the form array's "elements" array.
<script language="javascript" type="text/javascript">
function submitOrder() {
var formStuff = order_form.elements
var count = formStuff .length
for ( var i = 0 ; i < count; i++ )
{
try
{
formStuff [i].disabled = true
}
catch (ignore) { }
}
}
</script>
"Bruno Alexandre" <br***@filtrarte.com> wrote in message
news:eM**************@TK2MSFTNGP12.phx.gbl...
Hi guys,

Sorry about the off topic, but I can't find the ASP group just the ASP dot NET

If I want to block a user to change a form after submiting, I add a
function that will disable the submit button, but when I'm getting the
form
collection (using post or get (form/querystring) I can't retrieve that
button value...
Is there any trick to do this?

Like https://www.cuworld.com/ webpage... Try to register as a free user membership and after click the submit button check what hapend... They
disable all the form (checking the source code, they disable every form
input box) How can they retrieve the values if the form is disable?
<script language="javascript" type="text/javascript">
function submitOrder() {
var count = order_form.all.length;
for ( var i = 0 ; i < count; i++ ) {
try {
order_form.all[i].disabled = true;
}
catch (ignore) { }
}
}
</script>

All help is apreciate, and once again, I'm sorry about the offf topic, this is pure ASP and the group is for ASP.NET...

--

Bruno Alexandre
(Sintra, PORTUGAL)



Nov 18 '05 #4

"Bruno Alexandre" <br***@filtrarte.com> wrote in message
news:uP**************@TK2MSFTNGP09.phx.gbl...
But I have in the page:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
response.Write("- - - - - - - - - - - - - - - - -<br>")
for each item in request.Form
response.Write( item & ": " & request.Form( item ) & "<br>" )
next
response.Write("- - - - - - - - - - - - - - - - -<br>")
for each item in request.QueryString
response.Write( item & ": " & request.QueryString( item ) & "<br>" )
next
response.Write("- - - - - - - - - - - - - - - - -<br>")
%>

and I can't have nothing... not even a single bit, just the dotted line...
:(
so, how can you retrive the values?

the form is:

<form name="order_form" method="get" action=""
onSubmit="return(submitOrder());">

and I tried with

<form name="order_form" method="post" action=""
onSubmit="return(submitOrder());">

the page is in : http://208.21.165.173/portal/asp/test.asp
--

Bruno Alexandre
(Sintra, PORTUGAL)

"Scott M." <s-***@nospam.nospam> escreveu na mensagem
news:u4**************@tk2msftngp13.phx.gbl...
A couple of quick things here:

The form can be disabled to the end user, but the form's control values

can
still be accessed via code (Request.Form / Request.QueryString).

A button's value is retrieved just like any other form element:
Request.Form("buttonID") or Request.QueryString("buttonID")

I've modified your code a little, removing the "all" qualifier (this is

not
supported in NetScape) and instead use the form array's "elements" array.
<script language="javascript" type="text/javascript">
function submitOrder() {
var formStuff = order_form.elements
var count = formStuff .length
for ( var i = 0 ; i < count; i++ )
{
try
{
formStuff [i].disabled = true
}
catch (ignore) { }
}
}
</script>
"Bruno Alexandre" <br***@filtrarte.com> wrote in message
news:eM**************@TK2MSFTNGP12.phx.gbl...
> Hi guys,
>
> Sorry about the off topic, but I can't find the ASP group just the ASP > dot NET
>
>
>
> If I want to block a user to change a form after submiting, I add a
> function that will disable the submit button, but when I'm getting the
> form
> collection (using post or get (form/querystring) I can't retrieve that
> button value...
> Is there any trick to do this?
>
> Like https://www.cuworld.com/ webpage... Try to register as a free user > membership and after click the submit button check what hapend... They
> disable all the form (checking the source code, they disable every form
> input box) How can they retrieve the values if the form is disable?
>
>
> <script language="javascript" type="text/javascript">
> function submitOrder() {
> var count = order_form.all.length;
> for ( var i = 0 ; i < count; i++ ) {
> try {
> order_form.all[i].disabled = true;
> }
> catch (ignore) { }
> }
> }
> </script>
>
> All help is apreciate, and once again, I'm sorry about the offf topic, > this is pure ASP and the group is for ASP.NET...
>
> --
>
> Bruno Alexandre
> (Sintra, PORTUGAL)
>
>
>
>
>



Nov 18 '05 #5
their submit routine call form.submit, then disables the controls, then
cancels the original submit.

-- bruce (sqlwork.com)
"Bruno Alexandre" <br***@filtrarte.com> wrote in message
news:eM**************@TK2MSFTNGP12.phx.gbl...
Hi guys,

Sorry about the off topic, but I can't find the ASP group just the ASP
dot NET

If I want to block a user to change a form after submiting, I add a
function that will disable the submit button, but when I'm getting the form collection (using post or get (form/querystring) I can't retrieve that
button value...
Is there any trick to do this?

Like https://www.cuworld.com/ webpage... Try to register as a free user membership and after click the submit button check what hapend... They
disable all the form (checking the source code, they disable every form
input box) How can they retrieve the values if the form is disable?
<script language="javascript" type="text/javascript">
function submitOrder() {
var count = order_form.all.length;
for ( var i = 0 ; i < count; i++ ) {
try {
order_form.all[i].disabled = true;
}
catch (ignore) { }
}
}
</script>

All help is apreciate, and once again, I'm sorry about the offf topic,
this is pure ASP and the group is for ASP.NET...

--

Bruno Alexandre
(Sintra, PORTUGAL)


Nov 18 '05 #6
The problem is that your FORM tags have their ACTION set to nothing. Which
means that the form data doesn't get submitted anywhere (including the Form
or QueryString collections).

I assume you want the user to stay at this page after they have submitted
the form data and want the form to become disabled after submitting the form
data, right?

If so, add the name of this asp page to the ACTION attribute of your form
(ie. ACTION="order.asp"). Now, because the page will be re-loaded from
scratch the second time, you will need a way to know that the form data has
been submitted and disable the form. Here is what I would do for the entire
page:

OrderForm.asp
================================================== ======
<%@Language="VBScript"%>
<% Option Explicit %>
<HTML>
<HEAD>
<TITLE></TITLE>
<SCRIPT LANGUAGE="JavaScript" TYPE="Text/JavaScript">
function disableForm() {
var formStuff = order_form.elements
var count = formStuff .length
for ( var i = 0 ; i < count; i++ )
{
try
{
formStuff [i].disabled = true
}
catch (ignore) { }
}
}
</SCRIPT>
<HEAD>
<BODY>
<%
'Test to see if there is a value in the Form collection for the
submit button
'If there is, it must mean that the page is loading as a result of
the user submitting data
'and, in that case, we don't want the form controls to be enabled,
so
'we'll call the JS function that disables them.

If Request.Form("cmdSubmit") <> "" Then
Response.Write("<SCRIPT LANGUAGE='JavaScript'>")
Response.Write("disableForm()")
Response.Write("</SCRIPT>")
End If
%>

Your stuff here

<FORM NAME="order_form" METHOD="Post" ACTION="OrderForm.asp">

...Your form elements...

<INPUT TYPE="Submit" NAME="cmdSubmit" VALUE="Submit Order">

</FORM>
</BODY>

</HTML>

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

"Bruno Alexandre" <br***@filtrarte.com> wrote in message
news:uP**************@TK2MSFTNGP09.phx.gbl...
But I have in the page:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
response.Write("- - - - - - - - - - - - - - - - -<br>")
for each item in request.Form
response.Write( item & ": " & request.Form( item ) & "<br>" )
next
response.Write("- - - - - - - - - - - - - - - - -<br>")
for each item in request.QueryString
response.Write( item & ": " & request.QueryString( item ) & "<br>" )
next
response.Write("- - - - - - - - - - - - - - - - -<br>")
%>

and I can't have nothing... not even a single bit, just the dotted line...
:(
so, how can you retrive the values?

the form is:

<form name="order_form" method="get" action=""
onSubmit="return(submitOrder());">

and I tried with

<form name="order_form" method="post" action=""
onSubmit="return(submitOrder());">

the page is in : http://208.21.165.173/portal/asp/test.asp
--

Bruno Alexandre
(Sintra, PORTUGAL)

"Scott M." <s-***@nospam.nospam> escreveu na mensagem
news:u4**************@tk2msftngp13.phx.gbl...
A couple of quick things here:

The form can be disabled to the end user, but the form's control values

can
still be accessed via code (Request.Form / Request.QueryString).

A button's value is retrieved just like any other form element:
Request.Form("buttonID") or Request.QueryString("buttonID")

I've modified your code a little, removing the "all" qualifier (this is

not
supported in NetScape) and instead use the form array's "elements" array.
<script language="javascript" type="text/javascript">
function submitOrder() {
var formStuff = order_form.elements
var count = formStuff .length
for ( var i = 0 ; i < count; i++ )
{
try
{
formStuff [i].disabled = true
}
catch (ignore) { }
}
}
</script>
"Bruno Alexandre" <br***@filtrarte.com> wrote in message
news:eM**************@TK2MSFTNGP12.phx.gbl...
> Hi guys,
>
> Sorry about the off topic, but I can't find the ASP group just the ASP > dot NET
>
>
>
> If I want to block a user to change a form after submiting, I add a
> function that will disable the submit button, but when I'm getting the
> form
> collection (using post or get (form/querystring) I can't retrieve that
> button value...
> Is there any trick to do this?
>
> Like https://www.cuworld.com/ webpage... Try to register as a free user > membership and after click the submit button check what hapend... They
> disable all the form (checking the source code, they disable every form
> input box) How can they retrieve the values if the form is disable?
>
>
> <script language="javascript" type="text/javascript">
> function submitOrder() {
> var count = order_form.all.length;
> for ( var i = 0 ; i < count; i++ ) {
> try {
> order_form.all[i].disabled = true;
> }
> catch (ignore) { }
> }
> }
> </script>
>
> All help is apreciate, and once again, I'm sorry about the offf topic, > this is pure ASP and the group is for ASP.NET...
>
> --
>
> Bruno Alexandre
> (Sintra, PORTUGAL)
>
>
>
>
>



Nov 18 '05 #7
microsoft.public.inetserver.asp.general

I can probably help on this, but it is late. The ASP group is full of some
great guys.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************
Think Outside the Box!
************************************************
"Bruno Alexandre" <br***@filtrarte.com> wrote in message
news:eM**************@TK2MSFTNGP12.phx.gbl...
Hi guys,

Sorry about the off topic, but I can't find the ASP group just the ASP
dot NET

If I want to block a user to change a form after submiting, I add a
function that will disable the submit button, but when I'm getting the form collection (using post or get (form/querystring) I can't retrieve that
button value...
Is there any trick to do this?

Like https://www.cuworld.com/ webpage... Try to register as a free user membership and after click the submit button check what hapend... They
disable all the form (checking the source code, they disable every form
input box) How can they retrieve the values if the form is disable?
<script language="javascript" type="text/javascript">
function submitOrder() {
var count = order_form.all.length;
for ( var i = 0 ; i < count; i++ ) {
try {
order_form.all[i].disabled = true;
}
catch (ignore) { }
}
}
</script>

All help is apreciate, and once again, I'm sorry about the offf topic,
this is pure ASP and the group is for ASP.NET...

--

Bruno Alexandre
(Sintra, PORTUGAL)


Nov 18 '05 #8

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

Similar topics

0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.