Professional Web Applications Themes

Active Scripting !! - Dreamweaver AppDev

If the user forgets to type a text in a text box and press NEXT, he will get a message and goes back to the first page. <CFIF #Form.Lname# EQ ""> <script> alert("Type your name please."); self.location="javascript :history.back();" </script> <CFABORT> </CFIF> If the option Active Scripting in IE is disabled (by the user), this function does not work. How can I prevent the IE to bypass this option?? Red...

  1. #1

    Default Active Scripting !!

    If the user forgets to type a text in a text box and press NEXT, he will get a
    message and goes back to the first page.

    <CFIF #Form.Lname# EQ "">
    <script>
    alert("Type your name please.");
    self.location="javascript:history.back();"
    </script>
    <CFABORT>
    </CFIF>

    If the option Active Scripting in IE is disabled (by the user), this
    function does not work. How can I prevent the IE to bypass this option??


    Red


    Red-Hand Guest

  2. #2

    Default Re: Active Scripting !!

    use serverside validation instead. That way the user will send the
    information to the server, the server checks if the information is valid, if
    it is not instead of bringing an alert window to the user (which can be
    anoying) have the page to render a "friendly" error on the page or an arrow
    that points what the user is missing.


    --
    ....helmut
    helmutgranda.com



    "Red-Hand" <webforumsusermacromedia.com> wrote in message
    news:d6sk6o$nft$1forums.macromedia.com...
    > If the user forgets to type a text in a text box and press NEXT, he will
    > get a
    > message and goes back to the first page.
    >
    > <CFIF #Form.Lname# EQ "">
    > <script>
    > alert("Type your name please.");
    > self.location="javascript:history.back();"
    > </script>
    > <CFABORT>
    > </CFIF>
    >
    > If the option Active Scripting in IE is disabled (by the user), this
    > function does not work. How can I prevent the IE to bypass this option??
    >
    >
    > Red
    >
    >

    ...helmut Guest

  3. #3

    Default Re: Active Scripting !!

    Hi Helmut,

    Tank you for posting. Actually my second question was ? what is the different
    between Server side scripting and client side scripting?? When should Iuse
    server and when Client side scripting?? I am just a beginner therefore such a
    Stupid question!!!

    Red

    Red-Hand Guest

  4. #4

    Default Re: Active Scripting !!

    Client Side scripting is code that is passed in the page to the clients
    browser and the browser processes the script. The most common example of
    this is javascript.

    Server Side script is processed on the server and generally returns plain
    html to the browser.

    The choice of either depends upon what you are trying to achieve. Client
    side has the advantage that is doesn't require a trip to the server, so it
    is good for such things as simple calculations, and simple validation.

    The disadvantage is that it can be turned off by the client, which is why
    most experts recommend that for such things as validation that both client
    and server tests are deployed.



    --
    Regards

    Paul Whitham
    Macromedia Certified Professional for Dreamweaver MX2004
    Valleybiz Internet Design
    [url]www.valleybiz.net[/url]

    Team Macromedia Volunteer for Ultradev/Dreamweaver MX
    [url]www.macromedia.com/support/forums/team_macromedia[/url]

    "Red-Hand" <webforumsusermacromedia.com> wrote in message
    news:d6uh32$dm5$1forums.macromedia.com...
    > Hi Helmut,
    >
    > Tank you for posting. Actually my second question was ? what is the
    different
    > between Server side scripting and client side scripting?? When should Iuse
    > server and when Client side scripting?? I am just a beginner therefore
    such a
    > Stupid question!!!
    >
    > Red
    >

    Paul Whitham TMM Guest

  5. #5

    Default Re: Active Scripting !!

    Paul,

    I am using the scripting for such a falidation:

    <CFIF #Form.Lname# EQ "">
    <script>
    alert("Type your name please.");
    self.location="javascript:history.back();"
    </script>
    <CFABORT>
    </CFIF>

    As you said if the cliet turns off the scripting, I can not use this kind of
    scripting. But I must use it.Therefore I was looking for a Guid line about
    Server side scripting or other solution for my site.

    Regards
    Red

    Red-Hand Guest

  6. #6

    Default Re: Active Scripting !!

    What you have here is a piece of client side script inside of server side
    script. Top handle the situation where someone has Javascript turned off you
    could code it like this

    <cfset errornum = 0>
    <CFIF #Form.Lname# EQ "">
    <script>
    alert("Type your name please.");
    self.location="javascript:history.back();"
    </script>
    <noscript>
    <cfset errornum = 1>
    </noscript>
    <CFABORT>
    </CFIF>

    Then wrap the display code inside of an IF statement like this

    <CFIF errornum = 1>
    <p>You have not entered a value in the Last name field. Please press the
    back button and correct it</p>
    <cfelse>
    Your existing code
    </cfif>


    --
    Regards

    Paul Whitham
    Macromedia Certified Professional for Dreamweaver MX2004
    Valleybiz Internet Design
    [url]www.valleybiz.net[/url]

    Team Macromedia Volunteer for Ultradev/Dreamweaver MX
    [url]www.macromedia.com/support/forums/team_macromedia[/url]

    "Red-Hand" <webforumsusermacromedia.com> wrote in message
    news:d707tt$5b7$1forums.macromedia.com...
    > Paul,
    >
    > I am using the scripting for such a falidation:
    >
    > <CFIF #Form.Lname# EQ "">
    > <script>
    > alert("Type your name please.");
    > self.location="javascript:history.back();"
    > </script>
    > <CFABORT>
    > </CFIF>
    >
    > As you said if the cliet turns off the scripting, I can not use this kind
    of
    > scripting. But I must use it.Therefore I was looking for a Guid line about
    > Server side scripting or other solution for my site.
    >
    > Regards
    > Red
    >

    Paul Whitham TMM Guest

  7. #7

    Default Re: Active Scripting !!

    Paul,
    It is a nice solution. Tank you.
    I was thinking about something like this:

    On the page where you are going to

    <CFIF #Form.Lnaam# EQ "">
    <cfset ErrorPage = "Name.cfm?Message=" & URLEncodedFormat("You have not
    entered a value in the Last name field!!")>
    <cfset ErrorPage = ErrorPage & "&Lnaam=" & URLEncodedFormat(#Form.Lnaam#)>
    <cflocation url="#ErrorPage#">
    </cfif>

    And on the page wher you are from :

    <CFIF IsDefined("URL.Message")>
    <cfoutput><b> >>&nbsp;#URL.Message#&nbsp;<< </b></CFOUTPUT>
    </CFIF>
    But what I would like to find is:

    If you go to Sign In page of this site (Macro media), and if you type your
    login name and a wrong password, you will stay on the same page and you get a
    Error message.
    This falidation way is exactly what I am looking for.
    Do you know how it is built ?
    Do you also know how I can make a back button if Java is disabled on client
    site?

    Red

    Red-Hand Guest

Similar Threads

  1. Active X Control "click to active"
    By SringRVoyager in forum Macromedia Flash Player
    Replies: 1
    Last Post: July 30th, 10:54 PM
  2. NEED HELP with scripting...
    By 2s webforumsuser@macromedia.com in forum Macromedia Flash Actionscript
    Replies: 3
    Last Post: January 14th, 08:58 PM
  3. Replies: 5
    Last Post: August 1st, 02:57 AM
  4. scripting
    By desp. in forum Windows Setup, Administration & Security
    Replies: 11
    Last Post: July 17th, 05:11 AM
  5. LRP scripting
    By Raúl Alexis Betancort Santana in forum Debian
    Replies: 0
    Last Post: July 15th, 12:20 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139