onclick submit value text

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • José Carlos

    #1

    onclick submit value text

    Hi.

    I am trying send a text value when click in an image.

    If i write: onClick="javasc ript:document.c lient.submit(); " send all form,
    but i want to send only a input type text (name = cod), it´s possible?

    Thanks.

    Regards, José.


  • McKirahan

    #2
    Re: onclick submit value text

    "José Carlos" <josecarlos@sia dv.com> wrote in message
    news:csiksi$655 $1@nsnmpen3-gest.nuria.tele fonica-data.net...[color=blue]
    > Hi.
    >
    > I am trying send a text value when click in an image.
    >
    > If i write: onClick="javasc ript:document.c lient.submit(); " send all form,
    > but i want to send only a input type text (name = cod), it´s possible?
    >
    > Thanks.
    >
    > Regards, José.[/color]

    Have the onclick build a text field in a second form and submit it.

    onclick="submit 2()"

    <script type="text/javascript">
    function submit2() {
    document.client 2.cod.value = document.client .cod.value;
    document.client 2.submit();
    }
    </script>

    <form name="client2">
    <input type="hidden" name="cod">
    </form>

    Also, you don't need "javascript :" in your "onclick".



    Comment

    • José Carlos

      #3
      Re: onclick submit value text

      ok, it´s perfect. Thank.

      Is possible send a form where i write everythings and add other thing.? I
      want send a full form and add other text.

      Regards.


      "McKirahan" <News@McKirahan .com> escribió en el mensaje
      news:fKudnWSAM6 oNl3DcRVn-ig@comcast.com. ..[color=blue]
      > "José Carlos" <josecarlos@sia dv.com> wrote in message
      > news:csiksi$655 $1@nsnmpen3-gest.nuria.tele fonica-data.net...[color=green]
      >> Hi.
      >>
      >> I am trying send a text value when click in an image.
      >>
      >> If i write: onClick="javasc ript:document.c lient.submit(); " send all
      >> form,
      >> but i want to send only a input type text (name = cod), it´s possible?
      >>
      >> Thanks.
      >>
      >> Regards, José.[/color]
      >
      > Have the onclick build a text field in a second form and submit it.
      >
      > onclick="submit 2()"
      >
      > <script type="text/javascript">
      > function submit2() {
      > document.client 2.cod.value = document.client .cod.value;
      > document.client 2.submit();
      > }
      > </script>
      >
      > <form name="client2">
      > <input type="hidden" name="cod">
      > </form>
      >
      > Also, you don't need "javascript :" in your "onclick".
      >
      >
      >[/color]


      Comment

      • McKirahan

        #4
        Re: onclick submit value text

        "José Carlos" <josecarlos@sia dv.com> wrote in message
        news:cslioc$8a6 $1@nsnmpen3-gest.nuria.tele fonica-data.net...[color=blue]
        > ok, it´s perfect. Thank.
        >
        > Is possible send a form where i write everythings and add other thing.? I
        > want send a full form and add other text.
        >
        > Regards.[/color]

        [snip]

        Sure; add hidden fields to hold your "other text".


        Comment

        • José Carlos

          #5
          Re: onclick submit value text

          I trying this one, but it isn´t that i want because i have several images
          and several onclick events, depending of image i want to add diferent text.
          If i add hidden fields it´s sent always.


          "McKirahan" <News@McKirahan .com> escribió en el mensaje
          news:b_udnQBhy_ 3HzXPcRVn-2A@comcast.com. ..[color=blue]
          > "José Carlos" <josecarlos@sia dv.com> wrote in message
          > news:cslioc$8a6 $1@nsnmpen3-gest.nuria.tele fonica-data.net...[color=green]
          >> ok, it´s perfect. Thank.
          >>
          >> Is possible send a form where i write everythings and add other thing.? I
          >> want send a full form and add other text.
          >>
          >> Regards.[/color]
          >
          > [snip]
          >
          > Sure; add hidden fields to hold your "other text".
          >
          >[/color]


          Comment

          • José Carlos

            #6
            Re: onclick submit value text

            ok, sorry. i would haven´t understand you. It´s perfect.

            thank you by everythings.


            "José Carlos" <josecarlos@sia dv.com> escribió en el mensaje
            news:cslk5a$cdk $1@nsnmpen3-gest.nuria.tele fonica-data.net...[color=blue]
            >I trying this one, but it isn´t that i want because i have several images
            >and several onclick events, depending of image i want to add diferent text.
            >If i add hidden fields it´s sent always.
            >
            >
            > "McKirahan" <News@McKirahan .com> escribió en el mensaje
            > news:b_udnQBhy_ 3HzXPcRVn-2A@comcast.com. ..[color=green]
            >> "José Carlos" <josecarlos@sia dv.com> wrote in message
            >> news:cslioc$8a6 $1@nsnmpen3-gest.nuria.tele fonica-data.net...[color=darkred]
            >>> ok, it´s perfect. Thank.
            >>>
            >>> Is possible send a form where i write everythings and add other thing.?
            >>> I
            >>> want send a full form and add other text.
            >>>
            >>> Regards.[/color]
            >>
            >> [snip]
            >>
            >> Sure; add hidden fields to hold your "other text".
            >>
            >>[/color]
            >
            >[/color]


            Comment

            Working...