Assimilate function

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • BjoernJackschina

    #1

    Assimilate function

    Hello,
    I want to call a function. But this should only be possible when a
    value is reached. For example k=3 function is true, then loading the
    other function or my first idea another side, or either would be
    interesting without to take any button.

    Many thanks
  • lallous

    #2
    Re: Assimilate function

    Was hoping to help you but your question was not clear. Can you rephrase and
    include an example if possible.

    --
    Elias


    "BjoernJackschi na" <jacksch_1@hotm ail.com> wrote in message
    news:a24000a2.0 312080642.6c063 3c@posting.goog le.com...[color=blue]
    > Hello,
    > I want to call a function. But this should only be possible when a
    > value is reached. For example k=3 function is true, then loading the
    > other function or my first idea another side, or either would be
    > interesting without to take any button.
    >
    > Many thanks[/color]


    Comment

    • Thomas 'PointedEars' Lahn

      #3
      Re: Assimilate function

      BjoernJackschin a wrote:
      [color=blue]
      > I want to call a function. But this should only be possible when a
      > value is reached. For example k=3 function is true, then loading the
      > other function[/color]

      Are you looking for this?

      if (k() == 3)
      otherFunction() ;
      [color=blue]
      > or my first idea another side,[/color]

      You mean either `site', `page' or better -- `document'.
      [color=blue]
      > or either would be interesting without to take any button.[/color]

      Due to your improvable use of the English language, I can hardly
      understand what you are writing about.[1] Are you looking for
      some kind of redirection?


      PointedEars
      ___________
      [1] As for me, feel free to post/mail in German if this helps.
      I would post a summary in English.

      Comment

      • BjoernJackschina

        #4
        Re: Assimilate function

        Hello,
        here is an example:
        function count(f){
        var co=0;
        for(var i=0;i<f.element s.lenght;i++){
        if(f.elements.t ype == "radiobutto n"){
        co++;}
        }
        if (co >= 3){
        --> here should be calling the other function
        }
        ....

        <input type="button" value="co" onclick="count( this.form)">

        Thank you

        Comment

        • BjoernJackschina

          #5
          Re: Assimilate function

          Hello,
          it means redirection another page or calling another function.

          Comment

          • Thomas 'PointedEars' Lahn

            #6
            Re: Assimilate function

            BjoernJackschin a wrote:
            [color=blue]
            > here is an example:
            > function count(f){
            > var co=0;
            > for(var i=0;i<f.element s.lenght;i++){
            > if(f.elements.t ype == "radiobutto n"){
            > co++;}
            > }
            > if (co >= 3){
            > --> here should be calling the other function
            > }
            > ....
            >
            > <input type="button" value="co" onclick="count( this.form)">[/color]

            I can still only guess what you are trying to accomplish.

            I understand that you want to retrieve the number of radio buttons
            in a form and if that exceeds a specific value you want to call a function:

            // var f = document.forms[...];
            var co = 0;

            for (var i = 0; i < f.elements.leng th; i++)
            {
            co += (f.elements[i].type == "radio"); // false ~ 0, true ~ 1
            }

            if (co > 2)
            {
            otherFunction() ;
            }

            What about users without client-side JavaScript support?


            PointedEars

            Comment

            • Thomas 'PointedEars' Lahn

              #7
              Re: Assimilate function

              Thomas 'Ingrid' Lahn wrote:
              [color=blue]
              > BjoernJackschin a wrote:[color=green]
              >> I want to call a function. But this should only be possible when a
              >> value is reached. For example k=3 function is true, then loading the
              >> other function[/color]
              > [...]
              > ___________
              > [1] As for me, feel free to post/mail in German if this helps.
              > I would post a summary in English.[/color]

              Björn mailed me then and AIUI he only wanted to know how you can
              call a function and pass arguments to it, wondering especially
              about the use of quote characters in arguments. Since he did not
              replied to my explanation until today, I guess it was sufficient
              and gave him a lot of material to read on :)


              PointedEars

              Comment

              Working...