473,386 Members | 1,803 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,386 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 1850
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
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.