Submit() only some variables in JS

Discussion in 'ASP General' started by jcvel@canada.com, Feb 15, 2008.

  1. Guest

    Hi All:
    1. Is there any way of submitting only several variables froma form in
    JS ?
    I have some constraints in the server side, so I would like to have a
    button and when clicked, submit only certain variables.
    2. Creating a new form changes my formatting. Is there a way of
    creating a form and superimposing it on top of another ?

    Yes I am new to JS. Thanks for your help

    JC
     
    , Feb 15, 2008
    #1
    1. Advertising

  2. Evertjan. Guest

    wrote on 15 feb 2008 in microsoft.public.inetserver.asp.general:

    > Hi All:
    > 1. Is there any way of submitting only several variables froma form in
    > JS ?


    You cannot submit a clientside variable, only it's content. [semantics]

    > I have some constraints in the server side, so I would like to have a
    > button and when clicked, submit only certain variables.
    > 2. Creating a new form changes my formatting. Is there a way of
    > creating a form and superimposing it on top of another ?


    Done by a "superimposter"??

    You can make a second hidden form,
    copy the data you want to submit into that,
    and submit that form with javascript.


    > Yes I am new to JS. Thanks for your help


    Probably first learn some js on simpler tasks?

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
     
    Evertjan., Feb 15, 2008
    #2
    1. Advertising

  3. Evertjan. Guest

    Evertjan. wrote on 15 feb 2008 in microsoft.public.inetserver.asp.general:

    > wrote on 15 feb 2008 in microsoft.public.inetserver.asp.general:
    >
    >> Hi All:
    >> 1. Is there any way of submitting only several variables froma form in
    >> JS ?

    >
    > You cannot submit a clientside variable, only it's content. [semantics]
    >
    >> I have some constraints in the server side, so I would like to have a
    >> button and when clicked, submit only certain variables.
    >> 2. Creating a new form changes my formatting. Is there a way of
    >> creating a form and superimposing it on top of another ?

    >
    > Done by a "superimposter"??
    >
    > You can make a second hidden form,
    > copy the data you want to submit into that,
    > and submit that form with javascript.


    Come to think of it,
    just do not give those <input>
    a name and it won't be submitted,
    no js necessary.

    <form>
    <input name='sendMe' value='myData'><br>
    <input value='DataNoToBeSent'><br>
    <input type='submit' value='a button'>
    </form>

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
     
    Evertjan., Feb 15, 2008
    #3
  4. Tim Slattery Guest

    "Evertjan." <> wrote:

    >Come to think of it,
    >just do not give those <input>
    >a name and it won't be submitted,
    >no js necessary.


    Or set "disabled=true " for the ones you don't want to submit.
    I'd add "id" attributes to Evertjan's form:

    <form>
    <input name='sendMe' value='myData' id="sendme"><br>
    <input value='DataNoToBeSent' id="datano"><br>
    <input type='submit' value='a button'>
    </form>

    Then if you want to submit only sendme, run this statement before
    submitting:

    document.getElementById("sendme").disabled = true;

    --
    Tim Slattery
    MS MVP(Shell/User)

    http://members.cox.net/slatteryt
     
    Tim Slattery, Feb 15, 2008
    #4
  5. Guest

    On Feb 15, 8:42 am, Tim Slattery <> wrote:
    > "Evertjan." <> wrote:
    > >Come to think of it,
    > >just do not give those <input>
    > >a name and it won't be submitted,
    > >nojsnecessary.

    >
    > Or set "disabled=true " for the ones you don't want tosubmit.
    > I'd add "id" attributes to Evertjan's form:
    >
    > <form>
    > <input name='sendMe' value='myData' id="sendme"><br>
    > <input value='DataNoToBeSent' id="datano"><br>
    > <input type='submit' value='a button'>
    > </form>
    >
    > Then if you want tosubmitonlysendme, run this statement before
    > submitting:
    >
    > document.getElementById("sendme").disabled = true;
    >
    > --
    > Tim Slattery
    > MS MVP(Shell/User)
    > ://members.cox.net/slatteryt


    Thanks guy, all makes sense. I'll give atry and will reply my
    findings.!!!
     
    , Feb 15, 2008
    #5
  6. Guest

    On Feb 15, 9:26 am, wrote:
    > On Feb 15, 8:42 am, Tim Slattery <> wrote:
    >
    >
    >
    >
    >
    > > "Evertjan." <> wrote:
    > > >Come to think of it,
    > > >just do not give those <input>
    > > >a name and it won't be submitted,
    > > >nojsnecessary.

    >
    > > Or set "disabled=true " for the ones you don't want tosubmit.
    > > I'd add "id" attributes to Evertjan's form:

    >
    > > <form>
    > > <input name='sendMe' value='myData' id="sendme"><br>
    > > <input value='DataNoToBeSent' id="datano"><br>
    > > <input type='submit' value='a button'>
    > > </form>

    >
    > > Then if you want tosubmitonlysendme, run this statement before
    > > submitting:

    >
    > > document.getElementById("sendme").disabled = true;

    >
    > > --
    > > Tim Slattery
    > > MS MVP(Shell/User)
    > > ://members.cox.net/slatteryt

    >
    > Thanks guy, all makes sense. I'll give  atry and will reply my
    > findings.!!!- Hide quoted text -
    >
    > - Show quoted text -


    I tried it and it worked by disabling the <input..>
    Thanks yor your help
    Juan
     
    , Feb 15, 2008
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mark
    Replies:
    1
    Views:
    1,719
  2. ad
    Replies:
    2
    Views:
    727
  3. Shawn
    Replies:
    3
    Views:
    389
  4. Shawn
    Replies:
    4
    Views:
    357
    Patricia Shanahan
    Oct 28, 2006
  5. Replies:
    9
    Views:
    961
Loading...

Share This Page