Modify POST variables before to send

Discussion in 'Javascript' started by Tom Lobato, Jun 11, 2007.

  1. Tom Lobato

    Tom Lobato Guest

    Hi all,

    Is there a way for delete variables of a form just before it is
    sended to server?
    I don't want to delete the input element, but only to prevent that
    name/value to be sended to the server.


    Thank you,
    Tom Lobato
    Tom Lobato, Jun 11, 2007
    #1
    1. Advertising

  2. Tom Lobato

    Randy Webb Guest

    Tom Lobato said the following on 6/10/2007 8:20 PM:
    > Hi all,
    >
    > Is there a way for delete variables of a form just before it is
    > sended to server?
    > I don't want to delete the input element, but only to prevent that
    > name/value to be sended to the server.


    Set it's value to "". A better alternative is to have the server ignore
    the inputs. But, if you want the inputs ignored, why are they on the
    page to start with?

    --
    Randy
    Chance Favors The Prepared Mind
    comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
    Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
    Randy Webb, Jun 11, 2007
    #2
    1. Advertising

  3. Tom Lobato

    Tom Lobato Guest

    On Jun 10, 9:32 pm, Randy Webb <> wrote:
    > Tom Lobato said the following on 6/10/2007 8:20 PM:
    >
    > > Hi all,

    >
    > > Is there a way for delete variables of a form just before it is
    > > sended to server?
    > > I don't want to delete the input element, but only to prevent that
    > > name/value to be sended to the server.

    >
    > Set it's value to "". A better alternative is to have the server ignore
    > the inputs. But, if you want the inputs ignored, why are they on the
    > page to start with?


    Hi Randy, thank you for quick reply.

    This html sends the post request to a server that I cannot program:
    absolutefp script, that reads name/values's and creates a ms xls
    document.

    On client side, I need to have fields "phone_prefix" and
    "phone_number" on html form, but only send to final xls spreadsheet
    one field: "phone", that is a concatenation of both.




    Tom Lobato
    Tom Lobato, Jun 11, 2007
    #3
  4. Tom Lobato

    Randy Webb Guest

    Tom Lobato said the following on 6/10/2007 8:49 PM:
    > On Jun 10, 9:32 pm, Randy Webb <> wrote:
    >> Tom Lobato said the following on 6/10/2007 8:20 PM:
    >>
    >>> Hi all,
    >>> Is there a way for delete variables of a form just before it is
    >>> sended to server?
    >>> I don't want to delete the input element, but only to prevent that
    >>> name/value to be sended to the server.

    >> Set it's value to "". A better alternative is to have the server ignore
    >> the inputs. But, if you want the inputs ignored, why are they on the
    >> page to start with?

    >
    > Hi Randy, thank you for quick reply.
    >
    > This html sends the post request to a server that I cannot program:
    > absolutefp script, that reads name/values's and creates a ms xls
    > document.
    >
    > On client side, I need to have fields "phone_prefix" and
    > "phone_number" on html form, but only send to final xls spreadsheet
    > one field: "phone", that is a concatenation of both.


    Then have a hidden input named "phone" and update it whenever
    phone_number and phone_prefix get modified. And then, put them in a
    separate form so they don't get submitted.

    --
    Randy
    Chance Favors The Prepared Mind
    comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
    Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
    Randy Webb, Jun 11, 2007
    #4
  5. Tom Lobato

    Tom Lobato Guest

    On Jun 10, 10:40 pm, Randy Webb <> wrote:
    > Tom Lobato said the following on 6/10/2007 8:49 PM:
    >
    >
    >
    > > On Jun 10, 9:32 pm, Randy Webb <> wrote:
    > >> Tom Lobato said the following on 6/10/2007 8:20 PM:

    >
    > >>> Hi all,
    > >>> Is there a way for delete variables of a form just before it is
    > >>> sended to server?
    > >>> I don't want to delete the input element, but only to prevent that
    > >>> name/value to be sended to the server.
    > >> Set it's value to "". A better alternative is to have the server ignore
    > >> the inputs. But, if you want the inputs ignored, why are they on the
    > >> page to start with?

    >
    > > Hi Randy, thank you for quick reply.

    >
    > > This html sends the post request to a server that I cannot program:
    > > absolutefp script, that reads name/values's and creates a ms xls
    > > document.

    >
    > > On client side, I need to have fields "phone_prefix" and
    > > "phone_number" on html form, but only send to final xls spreadsheet
    > > one field: "phone", that is a concatenation of both.

    >
    > Then have a hidden input named "phone" and update it whenever
    > phone_number and phone_prefix get modified. And then, put them in a
    > separate form so they don't get submitted.


    Indeed, I tried to set to "" but it yet is send to server.

    Before I had thought in such solution (another form), but was
    searching something like
    post_request.remove(var1). Now I see that indeed making another form's
    is not a bad way (and maybe it is the only :).

    Thank you very much for the great help!



    Tom Lobato
    Tom Lobato, Jun 11, 2007
    #5
  6. Tom Lobato

    Tom Lobato Guest

    > On Jun 10, 10:40 pm, Randy Webb <> wrote:
    >
    > > > This html sends the post request to a server that I cannot program:
    > > > absolutefp script, that reads name/values's and creates a ms xls
    > > > document.

    >
    > > > On client side, I need to have fields "phone_prefix" and
    > > > "phone_number" on html form, but only send to final xls spreadsheet
    > > > one field: "phone", that is a concatenation of both.

    >
    > > Then have a hidden input named "phone" and update it whenever
    > > phone_number and phone_prefix get modified. And then, put them in a
    > > separate form so they don't get submitted.


    Is there some special way to use nested form's? I tried to put
    phone_number and phone_prefixa inside form "form_dummy", and this
    inside
    "form1", but the elements inside form_dummy are being send to server
    when
    I submit form1.


    Tom Lobato
    Tom Lobato, Jun 11, 2007
    #6
  7. Tom Lobato

    Randy Webb Guest

    Tom Lobato said the following on 6/11/2007 12:37 AM:
    >> On Jun 10, 10:40 pm, Randy Webb <> wrote:
    >>
    >>>> This html sends the post request to a server that I cannot program:
    >>>> absolutefp script, that reads name/values's and creates a ms xls
    >>>> document.
    >>>> On client side, I need to have fields "phone_prefix" and
    >>>> "phone_number" on html form, but only send to final xls spreadsheet
    >>>> one field: "phone", that is a concatenation of both.
    >>> Then have a hidden input named "phone" and update it whenever
    >>> phone_number and phone_prefix get modified. And then, put them in a
    >>> separate form so they don't get submitted.

    >
    > Is there some special way to use nested form's?


    You don't, as that creates invalid HTML.

    > I tried to put phone_number and phone_prefixa inside form
    > "form_dummy", and this inside "form1", but the elements
    > inside form_dummy are being send to server when I submit form1.


    That is why you can't nest them.

    --
    Randy
    Chance Favors The Prepared Mind
    comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
    Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
    Randy Webb, Jun 11, 2007
    #7
    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. Ron Vecchi
    Replies:
    4
    Views:
    482
    Jacob Yang [MSFT]
    Oct 31, 2003
  2. Lars Netzel

    How to send POST variables in my case?

    Lars Netzel, Oct 19, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    503
    bruce barker
    Oct 19, 2004
  3. =?Utf-8?B?TWFydGluIEJpc2Nob2Zm?=

    Modify SqlDataSource parameters before select

    =?Utf-8?B?TWFydGluIEJpc2Nob2Zm?=, Oct 20, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    27,933
    Steven Cheng[MSFT]
    Oct 25, 2005
  4. JEL
    Replies:
    0
    Views:
    195
  5. roN

    send post variables

    roN, Aug 11, 2006, in forum: Javascript
    Replies:
    1
    Views:
    87
    Randy Webb
    Aug 11, 2006
Loading...

Share This Page