Jul 20, 2008

Manipulating User Input From A Form

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > .NET ( ASP.net VB.net )

free web hosting

Manipulating User Input From A Form

kvarnerexpress
I have a HTML page with a form on it. I have an ASP page that processes what a user has entered into the form (updates a database etc).

I now need a page that fits between these two pages to “pre-process” the users input. I need to do it this way because I am not allowed to change either of the two existing pages.

I know how to read what the user has input into the form and I know how to pass control onto the next page.

What I have not been able to work out is how to change the user input and have those changes passed onto the next page as if nothing has happened (that is, the original ASP page just performs its request.form(“item”) calls as it always has but instead of seeing what the user actually typed in, it should see the changed text as created by the new “pre process” page)

I have tried using a regular expression replace but can only successfully make this change a variable and not the original form input. Equally I cannot find a way of swapping the original form input string with the output variable from the replace.

Does anyone have any ideas on this one?

Thanks in advance,

 

 

 


Reply

Tyssen
Can you save your changes to session variables which are then passed on to the next page?

Reply

chriswsk
To achieve your purpose, it depends on how your first page sending input data to the next page.

If the first page send the data to the next page via query string, it is easy. Just re-generate the query string is OK.

If the first page send the data to the next page via Session, it is also easy. You only need to modify the data and save it back to the Session...

If the first page send the data to the next page via form post method, you have to create some input fields or hidden fields in your middle page. Be ware that the fields should have the same id and name as those in the first page input fields. Then you only need to modify the data and set the fields value to the modifed data.

Then, you are done.

QUOTE(kvarnerexpress @ Dec 11 2005, 08:46 PM)
I have a HTML page with a form on it. I have an ASP page that processes what a user has entered into the form (updates a database etc).

I now need a page that fits between these two pages to “pre-process” the users input. I need to do it this way because I am not allowed to change either of the two existing pages.

I know how to read what the user has input into the form and I know how to pass control onto the next page.

What I have not been able to work out is how to change the user input and have those changes passed onto the next page as if nothing has happened (that is, the original ASP page just performs its request.form(“item”) calls as it always has but instead of seeing what the user actually typed in, it should see the changed text as created by the new “pre process” page)

I have tried using a regular expression replace but can only successfully make this change a variable and not the original form input. Equally I cannot find a way of swapping the original form input string with the output variable from the replace.

Does anyone have any ideas on this one?

Thanks in advance,
*


 

 

 


Reply

michaelper22
Do you want to use the response.redirect() method? if so then try this maybe:
CODE
response.redirect("newpage.asp?username="  & server.urlencode(request.form("username")) & "&password=" & server.urlencode(request.form("password"))

This grabs the form fields, URL-encodes them (to ensure that the browser doesn't choke on bad characters), and redirects to the next page with the URL-encoded variables in the querystring of the next page. Feel free to tinker with this.

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics

Keywords : manipulating user input

  1. User Login And Tracking - (4)
    know vba with MSAccess but need to create a web app of an MS Access App. I need to make it multi
    user with the user only being able to see and edit his own data. The db is quite simple and could
    have only a single table, but could divide into one main table with a couple of relational tables.
    I need the user to be able to login in and create his own password. I would want the user to have to
    validate (e-mail) simular to registering for this forum. I noticed that this forum is PHP driven. I
    thought that might be a better solution but a higher learning curve from vba t...
  2. New Ado.net User - (0)



Looking for manipulating, user, input, form

Searching Video's for manipulating, user, input, form
advertisement



Manipulating User Input From A Form



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE