If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > request form Variable problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-09-04, 04:37
marconi8 marconi8 is offline
Registered User
 
Join Date: May 2003
Posts: 50
request form Variable problem

when i post form collection all variables are accesable by this method
for example
response.write(request.form("textFieldValue"))


but i want to do this things
request.form("textFieldValue")=""

i want to aSSign value to the form value, but i get error
Object doesn't support this property or method: 'form'



what i'm doing wrong ?


thanks for help
Reply With Quote
  #2 (permalink)  
Old 08-09-04, 07:19
graceson graceson is offline
Registered User
 
Join Date: Mar 2004
Location: India
Posts: 56
Your problem is not much clear .Can you provide the part of code which you are using.

Using 'Request.form' you can not assign the values .This is using to retrieve the value assigned in varaiable.

If you want assign a value to a text box in a form you can use HTML tag.

best

graceson
Reply With Quote
  #3 (permalink)  
Old 08-09-04, 08:48
marconi8 marconi8 is offline
Registered User
 
Join Date: May 2003
Posts: 50
<%
if MY CONDITIONS then request.form("select1")=""


here i simply want to check posted variable request.form("select1")
if this var doesnt match to my conditions then i must to setup request.form("select1") variable to NULL

because second select component works when request.form("select1") is not empty

%>

when i was used php, in php i can do this things, but how can i assign value to request.form collection variable using ASP ????




<form method="post">


<select name="select1" onchange="submit()">
<option>...</option>
<%
set rs1 = create recordset ............
while rs1.EOF=false
%>
<option value="<%=rs1.fields("field_id")%>"><%=rs1.fields( "field_name")%></option>
<%
wend
%>
</select>


<select name="select2" onchange="submit()">
<option>...</option>
<%
if request.form("select1")<>"" then

set rs2 = create recordset ............
while rs2.EOF=false
%>
<option value="<%=rs2.fields("field_id")%>"><%=rs2.fields( "field_name")%></option>
<%
wend
%>

end if
</select>





</form>




thanks for help
Reply With Quote
  #4 (permalink)  
Old 08-09-04, 10:36
graceson graceson is offline
Registered User
 
Join Date: Mar 2004
Location: India
Posts: 56
difine a variable

assign the request .form in avaraiable and check the variable for the condition.


dim a

a=Request.form("select1")

if a (condition)

end if
Reply With Quote
  #5 (permalink)  
Old 08-10-04, 16:32
marconi8 marconi8 is offline
Registered User
 
Join Date: May 2003
Posts: 50
thanks

thanks for spending time, but this was simple.

my question was about form collection,



ok, it is not very big problem for me,
Reply With Quote
  #6 (permalink)  
Old 08-10-04, 19:26
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
the values in the forms collects are read only. you can request what is submitted and but you can not change the value.

the correct method of doing what you are trying to do is as suggested.

request the value once and apply it to a variable, from then on whenever you want to reference that form value you use the variable which is read/write.

this will also improve your performance as you don't need to go through the request object to find the values for things every time you want to perform a check or calculation.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On