473,796 Members | 2,658 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

rePOST form data without using GET

Hi all,

I was wondering if there's a technique to use POST instead of GET to
send data back to a form so to refill it with user input after this
hasn't passed validation.

Any clues?

Thanks,
Lorenzo

Feb 24 '06 #1
5 2178
it all depends... Do you want to do the validation client side or
server side? If you do it client side, in JS you can return false
in the onsubmit event of the form which will prevent the form from
actually being submitted. If it has to be done on the server side,
then you should investigate using a hash table to store field name/
value pairs. JSON is a data definition language that should be of
interest to you here... You could bundle all the form data into a
single object and pass that back to the form and repopulate all of
the fields quickly in the onload of the window.

some useful links..

Information about JSON

http://www.json.org/

Information about Prototype. This should make dealing with your forms
a bit easier... think of the power you have with the ability to hit the
server and process the response without refreshing the whole page.

http://prototype.conio.net/
http://www.sergiopereira.com/articles/prototype.js.html

This library builds on prototype.js by letting you use CSS Selectors to
assign methods to your elements.

http://bennolan.com/behaviour/

D.
Feb 24 '06 #2

lb********@gmai l.com wrote:
Hi all,

I was wondering if there's a technique to use POST instead of GET to
send data back to a form so to refill it with user input after this
hasn't passed validation.

Any clues?

Thanks,
Lorenzo


Yes.

If you code your form so that the values are populated with the
Request.Form variables, when it is first presented to users they will
be empty. On submission, assuming validation failed, if you show the
form again, the fields will be populated with the users submissions eg

<form action="" method="post">
<p>First Name: <input type="text" name="firstname "
value="<%=Reque st.Form("firstn ame")%>"></p>
<p>Surname: <input type="text" name="surname"
value="<%=Reque st.Form("surnam e")%>"></p>

etc

/P.

Feb 24 '06 #3

Paxton wrote:
If you code your form so that the values are populated with the
Request.Form variables, when it is first presented to users they will
be empty. On submission, assuming validation failed, if you show the
form again, the fields will be populated with the users submissions eg


Nice technique. I do most of my work in ColdFusion at this time and
this would not work so well... CF would complain about the vars not
being set initially, so there would be alof of CFParam tags...

D.
Feb 24 '06 #4

dNagel wrote:
Paxton wrote:
If you code your form so that the values are populated with the
Request.Form variables, when it is first presented to users they will
be empty. On submission, assuming validation failed, if you show the
form again, the fields will be populated with the users submissions eg


Nice technique. I do most of my work in ColdFusion at this time and
this would not work so well... CF would complain about the vars not
being set initially, so there would be alof of CFParam tags...

D.


I'm unfamiliar with CF. But in PHP you would have to check whether the
variable has been set to achieve this kind of thing, otherwise you
would get warnings:
value="<?php if isset($_POST['firstname']) { echo $_POST['firstname'];}
?>"

/P.

Feb 24 '06 #5

Paxton wrote:
If you code your form so that the values are populated with the
Request.Form variables, when it is first presented to users they will
be empty. On submission, assuming validation failed, if you show the
form again, the fields will be populated with the users submissions eg

<form action="" method="post">
<p>First Name: <input type="text" name="firstname "
value="<%=Reque st.Form("firstn ame")%>"></p>
<p>Surname: <input type="text" name="surname"
value="<%=Reque st.Form("surnam e")%>"></p>


Thanks Paxton, this is great stuff. First time I come across it...
don't think the docs on MSDN mention this.

Thanks again,
Lorenzo

Feb 24 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1260
by: Fresh Air Rider | last post by:
Hi Everyone Scenario A Webage has two dropdown lists, one for Suppliers and one for Products. When a user selects a supplier, it then populates the Products dropdown list with the relevant products for the selected supplier.
7
1653
by: David Shorthouse | last post by:
I am attempting to create a "new account creation" asp, but would ideally like the routine to check the Access db for an existing email address and username (called UID below). The select query called CheckAccount works as expected within the db as does the append query CreateAccount. However, the If statement below after DataConnection.CheckAccount obviously doesn't work because if I attempt to create an account for which either a username...
0
2053
by: Doug | last post by:
This is a repost of an item that I still cannot resolve. I have 3 combo boxes. The first leads to the second to the third. When I have selected a value in the second box, the third box shows the available information based on the second combo box selection. But if I change my mind and select a different item in the second box, after the third box has been populated, the third box still retains the information that was previously...
14
2841
by: Steve McLellan | last post by:
Hi, Sorry to repost, but this is becoming aggravating, and causing me a lot of wasted time. I've got a reasonably large mixed C++ project, and after a number of builds (but not a constant number) linking (and sometimes compiling) becomes immensely slow, and task manager shows that link.exe (or cl.exe) is barely using any processor time, but an awful lot of RAM (around 150-200MB). I'm going to keep an eye on page faults since I can't...
4
1326
by: Fernando Chilvarguer | last post by:
Hi, I've been trying to figure this one out for a while and I'm stalled. Here's my scenario: - a Parent window with a datagrid on it. The datagrid has pagination enabled and has an "Edit" link for each record. - Once someone clicks on the "Edit" link, a child window pops-up. The user edits the data and submits the form. All the server code is executed and
5
2449
by: Adrian Parker | last post by:
I've got the standard SqlCacheDependency working just fine , ie. I've defined (and encrypted) the connectionStrings section in the web.config, and I've also defined an an sqlCacheDependency in the caching section. So, in my code I add an item to the cache with an sqlCacheDependency, referencing the named sqlCacheDependency in the web.config and the database table it is to be based on (have enabled notificiations for that table). Fine. ...
2
2597
by: Suzanne | last post by:
Hi all, I'm reposting this message as I'm experiencing this problem more and more frequently : I really hope someone out there can help me as I've been tearing my hair out on this one for a good while and I'm getting really frustrated now! My problem is this - my custom controls periodically disappear from my
2
1311
by: Gerry | last post by:
I have a combo box and I can populate it with my class of dat (the class allows me to store each userid,username called - see code below I want the user to select the dropdown and see the username - but also determine the UserID from what was selected (using DisplayName from the combo box?? I can populate the combo box without problems - BUT the user sees "System.object" in each item of the combobox not the username ***here is my clas...
0
1845
by: teddysnips | last post by:
I have Search form that allows users to retrieve records into a DataGrid. There are two search criteria - a Month and a Year, which are selected from drop-down lists. There is a server-side button called "cmdFilter" which retrieves data from the database using any criteria thus selected. For any of the records retrieved into the grid match certain conditions, one of the columns will be formed into a hyperlink. Clicking on this will...
0
9685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10239
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10190
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9057
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7555
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5447
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4122
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2928
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.