Professional Web Applications Themes

How to solve this? - Macromedia Flash

I made a function for my standalone application like this: function playMyLabel(){ if (condition1){ if (condition2) { gotoAndPlay("label1"); } if (condition3) { gotoAndPlay("label2"); } } } When only condition2 or condition3 are true the function works fine but when both are true I'm not able to play the part starting from label1. How can I pause this script so it works like this: if (condition2){ gotoAndPlay("label1"); //wait until the movie stops, then continue } I could use a script at the end of label1 like this: gotoAndPlay("label2"); But I hope there's another way to solve this. Thanks Diederik...

  1. #1

    Default How to solve this?

    I made a function for my standalone application like this:

    function playMyLabel(){
    if (condition1){
    if (condition2) {
    gotoAndPlay("label1");
    }
    if (condition3) {
    gotoAndPlay("label2");
    }
    }

    }

    When only condition2 or condition3 are true the function works fine
    but when both are true I'm not able to play the part starting from label1.
    How can I pause this script so it works like this:

    if (condition2){
    gotoAndPlay("label1");
    //wait until the movie stops, then continue
    }

    I could use a script at the end of label1 like this:

    gotoAndPlay("label2");

    But I hope there's another way to solve this.

    Thanks
    Diederik

    Diederik Guest

  2. #2

    Default Re: How to solve this?

    Hi,


    your IF statement will only work if COND1 and COND2 are true. trhe question
    is what you need COND1 for?

    if (cond1 && cond2) {
    gotoAndPlay("l1");
    } else if (cond3) {
    gotoAndPlay("l2");
    }

    it all depends on what combinations of conditions you have ...


    nGFX


    --
    [url]http://www.widebight.de[/url]
    [url]http://www.cauldron-2.com[/url]
    [url]http://www.ngfx.de[/url]
    [url]http://www.the-wizards-hat.com[/url]

    People who used magic without knowing what they were doing usually came
    to a sticky end. All over the entire room, sometimes.
    -- Terry Pratchett, Moving Pictures


    p.s. nGFX is now selling his services: WideBight /2.0, flash games and 3D.
    contact: info (at) ngfx.de


    "Diederik" <Diederik.DD*SPAMTRAP*pandora.be> schrieb im Newsbeitrag
    news:jS3Za.57336$F92.6747afrodite.telenet-ops.be...
    > I made a function for my standalone application like this:
    >
    > function playMyLabel(){
    > if (condition1){
    > if (condition2) {
    > gotoAndPlay("label1");
    > }
    > if (condition3) {
    > gotoAndPlay("label2");
    > }
    > }
    >
    > }
    >
    > When only condition2 or condition3 are true the function works fine
    > but when both are true I'm not able to play the part starting from label1.
    > How can I pause this script so it works like this:
    >
    > if (condition2){
    > gotoAndPlay("label1");
    > //wait until the movie stops, then continue
    > }
    >
    > I could use a script at the end of label1 like this:
    >
    > gotoAndPlay("label2");
    >
    > But I hope there's another way to solve this.
    >
    > Thanks
    > Diederik
    >

    nGFX Guest

  3. #3

    Default Re: How to solve this?

    What you suggested is the easiest way to solve your problem. You could also
    create a frame loop using onEnterFrame to detect for a variable being set to
    true when the animation is over, but that's much more difficult. Although I
    think it's a cleaner option.

    --
    Shane Elliott
    [url]www.timberfish.com[/url]
    [url]www.friesontheside.com[/url]


    "Diederik" <Diederik.DD*SPAMTRAP*pandora.be> wrote in message
    news:jS3Za.57336$F92.6747afrodite.telenet-ops.be...
    > I made a function for my standalone application like this:
    >
    > function playMyLabel(){
    > if (condition1){
    > if (condition2) {
    > gotoAndPlay("label1");
    > }
    > if (condition3) {
    > gotoAndPlay("label2");
    > }
    > }
    >
    > }
    >
    > When only condition2 or condition3 are true the function works fine
    > but when both are true I'm not able to play the part starting from label1.
    > How can I pause this script so it works like this:
    >
    > if (condition2){
    > gotoAndPlay("label1");
    > //wait until the movie stops, then continue
    > }
    >
    > I could use a script at the end of label1 like this:
    >
    > gotoAndPlay("label2");
    >
    > But I hope there's another way to solve this.
    >
    > Thanks
    > Diederik
    >

    S. Elliott \(timberfish.com\) Guest

  4. #4

    Default Re: How to solve this?

    Hi,

    well, i think in that case (and without some heavy scripting) i would
    suggest the following:

    ---------------------------------------------------------------
    _root.OpenOption = -1 // no option selected, you may also use the mc you're
    in or _global

    // when openening an option:
    FunctionToCloseOpenOption( IDOfTheOpenedOption );


    // the function:
    function FunctionToCloseOpenOption(CurrentOpenedOption) {

    switch(_root.OpenOption) {
    case 1: // first option
    gotoAndPlay("...");
    break;
    case 2: // second one...
    ...
    }

    _root.OpenOption = CurrentOpenedOption; // set the current open option
    ....

    }
    -------------------------------------------

    .... or do it with arrays

    nGFX


    --
    [url]http://www.widebight.de[/url]
    [url]http://www.cauldron-2.com[/url]
    [url]http://www.ngfx.de[/url]
    [url]http://www.the-wizards-hat.com[/url]

    People who used magic without knowing what they were doing usually came
    to a sticky end. All over the entire room, sometimes.
    -- Terry Pratchett, Moving Pictures


    p.s. nGFX is now selling his services: WideBight /2.0, flash games and 3D.
    contact: info (at) ngfx.de



    "Diederik" <Diederik.DD*SPAMTRAP*pandora.be> schrieb im Newsbeitrag
    news:i2fZa.58478$F92.6781afrodite.telenet-ops.be...
    > On the left there's a movie with a large list of options. When you
    > click on certain options, not always, there are extra options so the
    > list has to scroll down to show the extra options. When I click for
    > the second time on an option with, lets say suboptions, I have to
    > close the opened list before opening the other one. Closing the list
    > doesn't seem to work.
    >
    > --
    > Diederik
    >
    > nGFX wrote:
    > > Hi,
    > >
    > >
    > > your IF statement will only work if COND1 and COND2 are true. trhe
    question
    > > is what you need COND1 for?
    > >
    > > if (cond1 && cond2) {
    > > gotoAndPlay("l1");
    > > } else if (cond3) {
    > > gotoAndPlay("l2");
    > > }
    > >
    > > it all depends on what combinations of conditions you have ...
    > >
    > >
    > > nGFX
    > >
    > >
    > > --
    > > [url]http://www.widebight.de[/url]
    > > [url]http://www.cauldron-2.com[/url]
    > > [url]http://www.ngfx.de[/url]
    > > [url]http://www.the-wizards-hat.com[/url]
    > >
    > > People who used magic without knowing what they were doing usually came
    > > to a sticky end. All over the entire room, sometimes.
    > > -- Terry Pratchett, Moving Pictures
    > >
    > >
    > > p.s. nGFX is now selling his services: WideBight /2.0, flash games and
    3D.
    > > contact: info (at) ngfx.de
    > >
    > >
    > > "Diederik" <Diederik.DD*SPAMTRAP*pandora.be> schrieb im Newsbeitrag
    > > news:jS3Za.57336$F92.6747afrodite.telenet-ops.be...
    > >
    >
    >
    > --
    > Diederik
    >

    nGFX Guest

  5. #5

    Default how to solve this?

    Hi,

    In 'test.htm', there are two Select, one visible, the other invisible. The
    second becomes visible only if the number of records in a Access table <2.
    There is also a button to start the VB-procedure. I choose first a value
    into the first Select (sel1), then i click on the button to start
    VB-procedure. If the value="a", then get the number of records in a table of
    Access. So i made a INPUT within a form and go to test2.asp which gets the
    number of records ('tot') i need.

    My problem is now: how to get back to 'test.htm' with the number of records
    ('tot') in order to test that number and to make or not the second Select
    visible?
    I can do this using RDS, because then everything can be put in VB, but i
    want to solve this without RDS.
    Thanks for any help.
    andré

    file 'test.htm':
    <SELECT name=sel >
    <option value="a" > a
    <option value="b" > b
    </SELECT>
    <SELECT name=sel2 style="visibility:hidden">
    <option value="c" > c
    <option value="d" > d
    </SELECT>

    <INPUT name=reg TYPE="button" value="test">

    <form name=ins>
    <input name="rpc" type="hidden" value="" >
    </form>

    <script language=vbscript>
    sub reg_onclick()
    value=sel.value
    if value="a" then
    doent.getElementById("rpc").value=a
    ins.action="test2.asp"
    ins.method="post"
    ins.submit
    end if

    if 'tot' obtained in test2.asp >=2 then
    msgbox ("you have already 2 items .. whatever .....")
    else
    sel2.style.visibility="visible"
    .....
    end if
    end sub
    </script>

    file 'test2.asp':
    <%
    set objdc = Server.CreateObject("ADODB.Connection")
    objdc.Open("provider=Microsoft.Jet.OLEDB.4.0; Data Source
    =d:\access\newres.mdb")
    sql="select items from mytable;"
    set rs=Server.CreateObject("ADODB.recordset")
    rs.open sql, objdc, 3, 3
    tot=rs.recordcount
    %>




    Andre Guest

  6. #6

    Default Re: how to solve this?

    "Andre" <aano.it> wrote in message
    news:OOS56E2WEHA.4032TK2MSFTNGP11.phx.gbl...
    > Hi,
    >
    > In 'test.htm', there are two Select, one visible, the other invisible. The
    > second becomes visible only if the number of records in a Access table <2.
    > There is also a button to start the VB-procedure. I choose first a value
    > into the first Select (sel1), then i click on the button to start
    > VB-procedure. If the value="a", then get the number of records in a table
    of
    > Access. So i made a INPUT within a form and go to test2.asp which gets the
    > number of records ('tot') i need.
    >
    > My problem is now: how to get back to 'test.htm' with the number of
    records
    > ('tot') in order to test that number and to make or not the second Select
    > visible?
    > I can do this using RDS, because then everything can be put in VB, but i
    > want to solve this without RDS.
    > Thanks for any help.
    > andré
    >
    > file 'test.htm':
    > <SELECT name=sel >
    > <option value="a" > a
    > <option value="b" > b
    > </SELECT>
    > <SELECT name=sel2 style="visibility:hidden">
    > <option value="c" > c
    > <option value="d" > d
    > </SELECT>
    >
    > <INPUT name=reg TYPE="button" value="test">
    >
    > <form name=ins>
    > <input name="rpc" type="hidden" value="" >
    > </form>
    >
    > <script language=vbscript>
    > sub reg_onclick()
    > value=sel.value
    > if value="a" then
    > doent.getElementById("rpc").value=a
    > ins.action="test2.asp"
    > ins.method="post"
    > ins.submit
    > end if
    >
    > if 'tot' obtained in test2.asp >=2 then
    > msgbox ("you have already 2 items .. whatever .....")
    > else
    > sel2.style.visibility="visible"
    > ....
    > end if
    > end sub
    > </script>
    >
    > file 'test2.asp':
    > <%
    > set objdc = Server.CreateObject("ADODB.Connection")
    > objdc.Open("provider=Microsoft.Jet.OLEDB.4.0; Data Source
    > =d:\access\newres.mdb")
    > sql="select items from mytable;"
    > set rs=Server.CreateObject("ADODB.recordset")
    > rs.open sql, objdc, 3, 3
    > tot=rs.recordcount
    > %>

    Where to start....

    1) The "form" tag should include all form elements; move it above the
    first "select" tag.

    2) 'a' is not a variable re: "doent.getElementById("rpc").value=a"

    3) "value" may be a reserved word and thus shouldn't be used as a
    variable name.

    4) A script written in "vbscript" only works on IE browsers.

    Why not just have a single recursive ASP page that doesn't use DHTML to
    "hide" the second select but rather shows it conditionally based on the
    results of the "recordcount".

    Perhaps something like the following; watch for word-wrap.

    <% Language="VBScript" %>
    <% Option Explicit
    Const cASP = "test.asp"
    Dim tot
    tot = 0
    If Request.Form("rpc") <> "" Then tot = Records()

    Function Records()
    Const cDSN = "provider=Microsoft.Jet.OLEDB.4.0; Data Source="
    Const cMDB = "d:\access\newres.mdb"
    Dim objdc
    Set objdc = Server.CreateObject("ADODB.Connection")
    objdc.Open(cDSN & cMDB)
    Dim sql
    sql = "SELECT items FROM mytable"
    Dim rs
    Set rs = Server.CreateObject("ADODB.recordset")
    rs.open sql, objdc, 3, 3
    Records = rs.recordcount
    Set rs = Nothing
    Set objdc = Nothing
    End Function
    %>
    <html>
    <head>
    <title><%=cASP%></title>
    <script type="text/javascript">
    function sel_rpc() {
    var valu = doent.getElementById("sel").value;
    doent.getElementById("rpc").value = valu;
    }
    </script>
    </head>
    <body>
    <form action="<%=cASP%>" method="post" name="ins" onsubmit="sel_rpc()">
    <select name="sel">
    <option value="a"> a
    <option value="b"> b
    </select>
    <% If tot = 1 Then %>
    <select name="sel2">
    <option value="c"> c
    <option value="d"> d
    </select>
    <% End If %>
    <input type="text" name="rpc" value="">
    <input type="submit" name="reg" value="test">
    </form>
    </body>
    </html>


    McKirahan Guest

  7. #7

    Default Re: how to solve this?

    On Sat, 26 Jun 2004 11:35:26 +0200, "Andre" <aano.it> wrote:
    >In 'test.htm', there are two Select, one visible, the other invisible. The
    >second becomes visible only if the number of records in a Access table <2.
    >There is also a button to start the VB-procedure. I choose first a value
    >into the first Select (sel1), then i click on the button to start
    >VB-procedure. If the value="a", then get the number of records in a table of
    >Access. So i made a INPUT within a form and go to test2.asp which gets the
    >number of records ('tot') i need.
    >
    >My problem is now: how to get back to 'test.htm' with the number of records
    >('tot') in order to test that number and to make or not the second Select
    >visible?
    >I can do this using RDS, because then everything can be put in VB, but i
    >want to solve this without RDS.
    You could either retrieve all records and store them in an array, or
    first do a query to count the records then a second query to retrieve
    what you need. The queries can be in a single page and don't need to
    be split into two pages.

    Jeff


    >file 'test.htm':
    ><SELECT name=sel >
    ><option value="a" > a
    ><option value="b" > b
    ></SELECT>
    ><SELECT name=sel2 style="visibility:hidden">
    ><option value="c" > c
    ><option value="d" > d
    ></SELECT>
    >
    ><INPUT name=reg TYPE="button" value="test">
    >
    ><form name=ins>
    ><input name="rpc" type="hidden" value="" >
    ></form>
    >
    ><script language=vbscript>
    >sub reg_onclick()
    >value=sel.value
    >if value="a" then
    >doent.getElementById("rpc").value=a
    >ins.action="test2.asp"
    >ins.method="post"
    >ins.submit
    >end if
    >
    >if 'tot' obtained in test2.asp >=2 then
    >msgbox ("you have already 2 items .. whatever .....")
    >else
    >sel2.style.visibility="visible"
    >....
    >end if
    >end sub
    ></script>
    >
    >file 'test2.asp':
    ><%
    >set objdc = Server.CreateObject("ADODB.Connection")
    >objdc.Open("provider=Microsoft.Jet.OLEDB.4.0; Data Source
    >=d:\access\newres.mdb")
    >sql="select items from mytable;"
    >set rs=Server.CreateObject("ADODB.recordset")
    >rs.open sql, objdc, 3, 3
    >tot=rs.recordcount
    >%>
    >
    >
    >
    Jeff Cochran Guest

  8. #8

    Default Re: how to solve this?

    Thanks both for replying ...
    I have one more question about your code:
    what is executed first? the server-side code, the client-code (not the sub
    and function of course) or is it just the HTML tag in the page? If it is the
    code between <% ...%>, then will If Request.Form("rpc") <> "" not always be
    false, because at that position in the code, the form is not yet defined?

    Andre

    > <% Language="VBScript" %>
    > <% Option Explicit
    > Const cASP = "test.asp"
    > Dim tot
    > tot = 0
    > If Request.Form("rpc") <> "" Then tot = Records()
    >
    > Function Records()
    > Const cDSN = "provider=Microsoft.Jet.OLEDB.4.0; Data Source="
    > Const cMDB = "d:\access\newres.mdb"
    > Dim objdc
    > Set objdc = Server.CreateObject("ADODB.Connection")
    > objdc.Open(cDSN & cMDB)
    > Dim sql
    > sql = "SELECT items FROM mytable"
    > Dim rs
    > Set rs = Server.CreateObject("ADODB.recordset")
    > rs.open sql, objdc, 3, 3
    > Records = rs.recordcount
    > Set rs = Nothing
    > Set objdc = Nothing
    > End Function
    > %>
    > <html>
    > <head>
    > <title><%=cASP%></title>
    > <script type="text/javascript">
    > function sel_rpc() {
    > var valu = doent.getElementById("sel").value;
    > doent.getElementById("rpc").value = valu;
    > }
    > </script>
    > </head>
    > <body>
    > <form action="<%=cASP%>" method="post" name="ins" onsubmit="sel_rpc()">
    > <select name="sel">
    > <option value="a"> a
    > <option value="b"> b
    > </select>
    > <% If tot = 1 Then %>
    > <select name="sel2">
    > <option value="c"> c
    > <option value="d"> d
    > </select>
    > <% End If %>
    > <input type="text" name="rpc" value="">
    > <input type="submit" name="reg" value="test">
    > </form>
    > </body>
    > </html>
    >
    >

    Andre Guest

  9. #9

    Default Re: how to solve this?

    "Andre" <aano.it> wrote in message
    news:OpG8EzNXEHA.3716TK2MSFTNGP11.phx.gbl...
    > Thanks both for replying ...
    > I have one more question about your code:
    > what is executed first? the server-side code, the client-code (not the sub
    > and function of course) or is it just the HTML tag in the page? If it is
    the
    > code between <% ...%>, then will If Request.Form("rpc") <> "" not always
    be
    > false, because at that position in the code, the form is not yet defined?
    >
    > Andre
    [snip]

    The server-side code executes before the client-side code.


    Re: If Request.Form("rpc") <> "" Then tot = Records()

    Because the form element "rpc" is not defined on the intial execution, the
    statement will evaluate to blank; thus, not executing the Records() function
    (which is what we want).


    McKirahan Guest

  10. #10

    Default Re: how to solve this?

    Thanks again.

    Maybe a last point:
    suppose the webpage contains a lot of buttons which each starts a procedure.
    Each procedure needs to access the database with parameters (e.g.
    sql="select name where name='" & naam & "'").
    Is there no better way than to use a form for each button in order to pass
    the parameter with Action="it's own file name"? The whole asp file will each
    time be read from beginning to end.
    Like i said, with RDS ii's very simple because the db can be accessed within
    VBscript. But i don't want to use it for different reasons.
    What i miss is a way to switch between ASP with the database and VB with the
    buttons ...





    Andre Guest

  11. #11

    Default Re: how to solve this?

    On Tue, 29 Jun 2004 15:52:28 +0200, "Andre" <aano.it> wrote:
    >Maybe a last point:
    >suppose the webpage contains a lot of buttons which each starts a procedure.
    >Each procedure needs to access the database with parameters (e.g.
    >sql="select name where name='" & naam & "'").
    >Is there no better way than to use a form for each button in order to pass
    >the parameter with Action="it's own file name"? The whole asp file will each
    >time be read from beginning to end.
    >Like i said, with RDS ii's very simple because the db can be accessed within
    >VBscript. But i don't want to use it for different reasons.
    >What i miss is a way to switch between ASP with the database and VB with the
    >buttons ...
    There's still a basic misunderstanding you seem to have. ASP is
    server side. It is processed on the server. Buttons are client side,
    and processed on the client. For a button to produce an action, it
    has to communicate with the server if it will use ASP code, or there
    has to be a client side application or script to handle the button's
    actions. You can easily write the button actions in VB and compile
    into an ActiveX control, but this is all client side. When you need
    to retrieve data from the database, that happens server side.

    For a button to activate server side code it has to make a call to a
    server side page in some manner. The manner that ASP accepts is form
    input or query parameters in a http request. You can use a Javascript
    or other client-side script to trigger the button action, but you
    still need to use a from or query in order to get the response to ASP
    on the server side.

    Is there a better way? Better depends on your perspective and needs,
    but you can always write a VB front end to access your database. But
    that's not ASP.

    Also, look at .NET coding, you may find yourself more comfortable
    exploring that route.

    Jeff
    Jeff Cochran Guest

  12. #12

    Default Re: how to solve this?

    "Andre" <aano.it> wrote in message
    news:edtZkCeXEHA.2716tk2msftngp13.phx.gbl...
    > Thanks again.
    >
    > Maybe a last point:
    > suppose the webpage contains a lot of buttons which each starts a
    procedure.
    > Each procedure needs to access the database with parameters (e.g.
    > sql="select name where name='" & naam & "'").
    > Is there no better way than to use a form for each button in order to
    pass
    > the parameter with Action="it's own file name"? The whole asp file will
    each
    > time be read from beginning to end.
    > Like i said, with RDS ii's very simple because the db can be accessed
    within
    > VBscript. But i don't want to use it for different reasons.
    > What i miss is a way to switch between ASP with the database and VB with
    the
    > buttons ...

    You don't need a form for each button.

    Define a "hidden" form field then, using JavaScript, set their values based
    on which button was clicked.

    For example,

    <form onsubmit="return submits()">
    <input type="hidden" name="choice" value="0">
    <br><input type="button" value="Option 1" onclick="return buttons(1)">Select
    by Name
    <br><input type="button" value="Option 2" onclick="return buttons(2)">Select
    by City
    <br><input type="button" value="Option 3" onclick="return buttons(3)">Select
    by State
    </form>

    <script type="text/javascript">
    function buttons(what) {
    doent.getElementById("choice").value = what;
    }
    function submits() {
    if (doent.getElementById("choice").value = "0") return false
    return true;
    }
    </script>

    Finally, in your ASP code test the value of Request.Form(choice") and take
    the desired action.


    McKirahan Guest

  13. #13

    Default Re: how to solve this?

    thanks to all

    "McKirahan" <NewsMcKirahan.com> wrote in message
    news:SYiEc.30$Oq2.27attbi_s52...
    > "Andre" <aano.it> wrote in message
    > news:edtZkCeXEHA.2716tk2msftngp13.phx.gbl...
    > > Thanks again.
    > >
    > > Maybe a last point:
    > > suppose the webpage contains a lot of buttons which each starts a
    > procedure.
    > > Each procedure needs to access the database with parameters (e.g.
    > > sql="select name where name='" & naam & "'").
    > > Is there no better way than to use a form for each button in order to
    > pass
    > > the parameter with Action="it's own file name"? The whole asp file will
    > each
    > > time be read from beginning to end.
    > > Like i said, with RDS ii's very simple because the db can be accessed
    > within
    > > VBscript. But i don't want to use it for different reasons.
    > > What i miss is a way to switch between ASP with the database and VB with
    > the
    > > buttons ...
    >
    >
    > You don't need a form for each button.
    >
    > Define a "hidden" form field then, using JavaScript, set their values
    based
    > on which button was clicked.
    >
    > For example,
    >
    > <form onsubmit="return submits()">
    > <input type="hidden" name="choice" value="0">
    > <br><input type="button" value="Option 1" onclick="return
    buttons(1)">Select
    > by Name
    > <br><input type="button" value="Option 2" onclick="return
    buttons(2)">Select
    > by City
    > <br><input type="button" value="Option 3" onclick="return
    buttons(3)">Select
    > by State
    > </form>
    >
    > <script type="text/javascript">
    > function buttons(what) {
    > doent.getElementById("choice").value = what;
    > }
    > function submits() {
    > if (doent.getElementById("choice").value = "0") return false
    > return true;
    > }
    > </script>
    >
    > Finally, in your ASP code test the value of Request.Form(choice") and take
    > the desired action.
    >
    >

    Andre Guest

  14. #14

    Default Re: how to solve this?

    "McKirahan" <NewsMcKirahan.com> wrote in message
    news:SYiEc.30$Oq2.27attbi_s52...
    > "Andre" <aano.it> wrote in message
    > news:edtZkCeXEHA.2716tk2msftngp13.phx.gbl...
    > > Thanks again.
    > >
    > > Maybe a last point:
    > > suppose the webpage contains a lot of buttons which each starts a
    > procedure.
    > > Each procedure needs to access the database with parameters (e.g.
    > > sql="select name where name='" & naam & "'").
    > > Is there no better way than to use a form for each button in order to
    > pass
    > > the parameter with Action="it's own file name"? The whole asp file will
    > each
    > > time be read from beginning to end.
    > > Like i said, with RDS ii's very simple because the db can be accessed
    > within
    > > VBscript. But i don't want to use it for different reasons.
    > > What i miss is a way to switch between ASP with the database and VB with
    > the
    > > buttons ...
    >
    >
    > You don't need a form for each button.
    >
    > Define a "hidden" form field then, using JavaScript, set their values
    based
    > on which button was clicked.
    >
    > For example,
    >
    > <form onsubmit="return submits()">
    > <input type="hidden" name="choice" value="0">
    > <br><input type="button" value="Option 1" onclick="return
    buttons(1)">Select
    > by Name
    > <br><input type="button" value="Option 2" onclick="return
    buttons(2)">Select
    > by City
    > <br><input type="button" value="Option 3" onclick="return
    buttons(3)">Select
    > by State
    > </form>
    >
    > <script type="text/javascript">
    > function buttons(what) {
    > doent.getElementById("choice").value = what;
    > }
    > function submits() {
    > if (doent.getElementById("choice").value = "0") return false
    > return true;
    > }
    > </script>
    >
    > Finally, in your ASP code test the value of Request.Form(choice") and take
    > the desired action.
    >

    Oops, my pseudo-code "if" javascript logic should use "==" not "=" as in:

    if (doent.getElementById("choice").value == "0") return false;


    McKirahan Guest

Similar Threads

  1. can anyone solve this??
    By G Dean Blake in forum ASP.NET Data Grid Control
    Replies: 5
    Last Post: January 18th, 03:43 PM
  2. How to solve this problem using .NET?
    By jeroen in forum ASP.NET Web Services
    Replies: 0
    Last Post: September 30th, 06:45 PM
  3. How to solve it ?
    By DotNetJunkies User in forum ASP.NET Security
    Replies: 0
    Last Post: August 11th, 09:59 PM
  4. how can i solve this problem?
    By Joseph Gellidon via .NET 247 in forum ASP.NET Security
    Replies: 0
    Last Post: June 18th, 06:38 AM
  5. Is there anyone on the planet that can solve this??
    By xianshino3@adobeforums.com in forum Adobe Illustrator Windows
    Replies: 3
    Last Post: April 4th, 05:17 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