I have a form with three fields for date of birth, day/month/year. When a user selects their dob, if not all details on the form are correct then the form is reloaded with any data entered already still there for the user, the problem i have is keeping the dob selected in the select fields, say a user select 21/04/1988 the three dob selects would default to dd/mm/yyyy which are the three default values, i need it to stay on the user selected date the user entered!??
6 4803
Set the options as selected, e.g. - <option value="24" selected="selected">24</option>
Of course, HTML won't be able to tell you which option was previously selected; you'll need javascript (or something else) for that.
I assumed that form reload meant a page reload, so you'd use server-side code to determine which option should be selected.
Can I suggest using javascript to validate the form before it is submitted to the server to process. Not only does this save on server load, but it also is a quicker response for the user.
Basically you write some javascript code which checks that all the values entered are valid before it sends it to be processed. This is not 100% because a small percentage of users have javascript disabled, but it should work for most of your visitors... The worth while ones atleast :P
Google "Validate forms javascript" or something like that to get some sample codes.
@TheServant
I've done all the validation through the PHP script as not everyone will have javascript enabled!
Go the 'selected' thing working, thanks!
It is a good idea to have both javascript validation as well as PHP validation. It reduces the number of requests and saves the user time as I mentioned. Anyway, glad to hear it's working.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: jason |
last post by:
Is it possible to POST a FORM to multiple URLS at the same time....OR....
Is the only workaround for this scenario to use response.redirect in the
called ASP page and do a multi processing?
-...
|
by: Mark Watkins |
last post by:
suppose I have the following:
-----------BEGIN page1.asp----------
<form method="post" action="page2.asp">
<select name="someData" size="1" class="smallbutton">
<option...
|
by: Doug O'Leary |
last post by:
Hey, all.
I have a perl script which generates the html listed below. I cleaned it
up a bit since the perl CGI module creates some really ugly html code.
I've looked at this thing 8 ways to...
|
by: Steve |
last post by:
Form FrmRestock's recordsource is QryFrmRestock. The TransactionDate field's
criteria is set ats:
Forms!FrmRestock!LastXDays. LastXDays on the form is a combobox where the
selections are 30, 60...
|
by: Almir |
last post by:
I have a simple problem, i just can get a grasp on it. I designed a
database for inventory of computer equipment. Now i created forms for
each table. Each piece of equipment is going to come in an...
|
by: Earthling |
last post by:
Any help would be appreciated to solve the following simple problem that
I will describe.
***
There is a form called "red chocolate form".
The form has a particular subform field that has a...
|
by: Bill |
last post by:
I'm using the POST method to submit a simple form html page with yes/no
and checkbox fields to an asp response page which stores the values in
a new dim string, then uses it to build a new table...
|
by: Rick Owen |
last post by:
Greetings,
I have a form that, when submitted, calls a plsql procedure. The form
has a number of fields (text, hidden, select, radio) but the
particular field that is giving me problems is a...
|
by: chromis |
last post by:
Hi,
I'm writing a contacts section for a cms on a website, I've decided to write the section in OO code. So far I have my Contacts object and a page structure I would use for a procedural site.
...
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
| |