Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Javascript (http://www.velocityreviews.com/forums/f68-javascript.html)
-   -   Modify POST variables before to send (http://www.velocityreviews.com/forums/t931583-modify-post-variables-before-to-send.html)

Tom Lobato 06-11-2007 12:20 AM

Modify POST variables before to send
 

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


Randy Webb 06-11-2007 12:32 AM

Re: Modify POST variables before to send
 
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/

Tom Lobato 06-11-2007 12:49 AM

Re: Modify POST variables before to send
 
On Jun 10, 9:32 pm, Randy Webb <HikksNotAtH...@aol.com> 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


Randy Webb 06-11-2007 01:40 AM

Re: Modify POST variables before to send
 
Tom Lobato said the following on 6/10/2007 8:49 PM:
> On Jun 10, 9:32 pm, Randy Webb <HikksNotAtH...@aol.com> 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/

Tom Lobato 06-11-2007 03:47 AM

Re: Modify POST variables before to send
 
On Jun 10, 10:40 pm, Randy Webb <HikksNotAtH...@aol.com> wrote:
> Tom Lobato said the following on 6/10/2007 8:49 PM:
>
>
>
> > On Jun 10, 9:32 pm, Randy Webb <HikksNotAtH...@aol.com> 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 06-11-2007 04:37 AM

Re: Modify POST variables before to send
 
> On Jun 10, 10:40 pm, Randy Webb <HikksNotAtH...@aol.com> 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


Randy Webb 06-11-2007 11:12 AM

Re: Modify POST variables before to send
 
Tom Lobato said the following on 6/11/2007 12:37 AM:
>> On Jun 10, 10:40 pm, Randy Webb <HikksNotAtH...@aol.com> 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/


All times are GMT. The time now is 09:08 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.