Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asptoday_discuss thread: Checking value of hidden field with Request.Form


Message #1 by "Kevin Abbott" <K.Abbott@b...> on Tue, 4 Dec 2001 15:12:25
Hi,



I can successfully get data from a previous form using Request.Form.



Here's my code:



I get the value from previous form:



var From1 = Request.Form("From1");



Just after my BODY tag I write:



<%if(From1==""){%>

<script Language="Javascript">

<!--

alert("You have not answered all the question for this section!  You will 

now be redirected to the first 

architecture question");

// -->

</script>

<%}%>



The problem I'm having is that when From1 has no value. I want the script 

below to run, but I can't 

ever get it to work.



I've also tried:



From1==null

From1==false

From1==0

if(From1!=null){}else{...}



None of these work!  Whats the correct why to check the value of this 

variable?



Thanks in advance.
Message #2 by "Greg Jennings" <greg.jennings@t...> on Tue, 4 Dec 2001 16:57:41
> Hi,

> 

> I can successfully get data from a previous form using Request.Form.

> 

> Here's my code:

> 

> I get the value from previous form:

> 

> var From1 = Request.Form("From1");

> 

> Just after my BODY tag I write:

> 

> <%if(From1==""){%>

> <script Language="Javascript">

> <!--

> alert("You have not answered all the question for this section!  You 

will 

> now be redirected to the first 

> architecture question");

> // -->

> </script>

> <%}%>

> 

> The problem I'm having is that when From1 has no value. I want the 

script 

> below to run, but I can't 

> ever get it to work.

> 

> I've also tried:

> 

> From1==null

> From1==false

> From1==0

> if(From1!=null){}else{...}

> 

> None of these work!  Whats the correct why to check the value of this 

> variable?

> 

> Thanks in advance. 



Try this...



If Request.Form("From1") Is Nothing Then

Else

End If
Message #3 by "Jason Salas" <jason@k...> on Wed, 5 Dec 2001 19:05:26 +1000
Hi Kevin,



Are you sure the NAME attribute in the hidden field in your previous form is

set to "From1"?



<input type="hidden" name="From1" value="3.141615">



That may be why it's not pulling the value in your JavaScript.



HTH,

Jason





----- Original Message -----

From: "Kevin Abbott" <K.Abbott@b...>

To: "ASPToday Discuss" <asptoday_discuss@p...>

Sent: Tuesday, December 04, 2001 3:12 PM

Subject: [asptoday_discuss] Checking value of hidden field with Request.Form





> Hi,

>

> I can successfully get data from a previous form using Request.Form.

>

> Here's my code:

>

> I get the value from previous form:

>

> var From1 = Request.Form("From1");

>

> Just after my BODY tag I write:

>

> <%if(From1==""){%>

> <script Language="Javascript">

> <!--

> alert("You have not answered all the question for this section!  You will

> now be redirected to the first

> architecture question");

> // -->

> </script>

> <%}%>

>

> The problem I'm having is that when From1 has no value. I want the script

> below to run, but I can't

> ever get it to work.

>

> I've also tried:

>

> From1==null

> From1==false

> From1==0

> if(From1!=null){}else{...}

>

> None of these work!  Whats the correct why to check the value of this

> variable?

>

> Thanks in advance.




$subst('Email.Unsub')

>




  Return to Index