Question on asp condition

Results 1 to 2 of 2

Thread: Question on asp condition

  1. #1
    Join Date
    Dec 1969

    Default Question on asp condition

    i had created a condition in asp that goes like this:<BR><BR>if fname = "" or lname = "" or gender = "" or address = "" then %&#062;<BR><BR> &#060;script type="text/javascript"&#062;<BR><BR> alert("Please complete the necessary details before saving!")<BR><BR> &#060;/script&#062;<BR> <BR>&#060;% response.Redirect("guestbook.asp") %&#062;<BR><BR>when the first condition is true it goes directly to the response command rather than executing the script and when i delete the response command it executes the script please guide me on how to fix this.<BR><BR>thanks in advance...<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Question on asp condition

    The script runs on the client machine.<BR>The Client/browser does not see the script untill it is sent to it.<BR><BR>The response runs on the server...<BR>Server executes all asp code on server<BR>then sends everything to client to be displayed.<BR><BR>So whats hapening is the asp/vbs is following your code and redirecting to get another page and display it instead.<BR><BR>What would you prefer.<BR>Show them the Alert in browser?<BR>Or redirect them to the other page?<BR><BR>It&#039;s your call.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts