473,225 Members | 1,314 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,225 software developers and data experts.

Dynamic Web Forms

I've created a form with several input fields. At the beginning of my
form I use a set of radio buttons to determine how to validate the form as
well as determine what fields are required. Because the form is so lengthy,
I would like to aid users by including visual clues as to what fields
require information by changing the background color of that field to red. I
understand how to accomplish this field by field however, I am looking for
an easier way. Rather that write a big messy function which declares
(document.form.name.style.backgroundColor='red') for every single field, I'd
like to be able to broadcast this command to several chosen fields at once.
Any suggestion would be greatly appreciated.

Best Regards,

Martin Franklin

--
MA********@cox.net

Jul 21 '05 #1
9 3408
"MA********@cox.net" <MA********@Cox.net> a écrit dans le message de
news:CNFfd.19527$SW3.507@fed1read01
I've created a form with several input fields. At the beginning of
my form I use a set of radio buttons to determine how to validate the
form as well as determine what fields are required. Because the form
is so lengthy, I would like to aid users by including visual clues as
to what fields require information by changing the background color
of that field to red. I understand how to accomplish this field by
field however, I am looking for an easier way. Rather that write a
big messy function which declares
(document.form.name.style.backgroundColor='red') for every single
field, I'd like to be able to broadcast this command to several
chosen fields at once. Any suggestion would be greatly appreciated.


Didn't understand very well, but maybe :

<input class="required" ...

Jul 21 '05 #2
"MA********@cox.net" <MA********@Cox.net> writes:
I've created a form with several input fields. At the beginning of my
form I use a set of radio buttons to determine how to validate the form as
well as determine what fields are required. Because the form is so lengthy,


Why not make the form two steps? In the first step, they select a
radio button and submit the form. Depending on which radio button is
selected, they get a different form in the second step.

--
Chris
Jul 21 '05 #3
MA********@cox.net wrote:
I've created a form with several input fields. At the beginning of
my form I use a set of radio buttons to determine how to validate the
form as well as determine what fields are required. Because the form
is so lengthy, I would like to aid users by including visual clues as
to what fields require information by changing the background color
of that field to red. I understand how to accomplish this field by
field however, I am looking for an easier way. Rather that write a
big messy function which declares
(document.form.name.style.backgroundColor='red') for every single
field, I'd like to be able to broadcast this command to several
chosen fields at once. Any suggestion would be greatly appreciated.


Put the names of the required fields into an array and loop through it to
execute your above statement. This is a Javascript task, so if you need more
help you will find it in a Javascript group. This will be small and clean.

There is no way to change CSS properties of a group of fields globally but
changing them via Javascript.

HTH
Markus
Jul 21 '05 #4
On Wed, 27 Oct 2004 13:09:16 +0200, Markus Ernst <derernst@NO#SP#AMgmx.ch>
wrote:

[snip]
This is a Javascript task, so if you need more help you will find it in
a Javascript group. This will be small and clean.
Actually, the OP was directed from c.l.js because this would be better
handled with CSS. As Pierre suggested, something like:

.required {
background-color: #ff9f9f;
color: #000000;
}

<input class="required" ...>

would be more appropriate.
There is no way to change CSS properties of a group of fields globally
but changing them via Javascript.


On some arbitrary run-time trigger, no there isn't, but I don't think
that's what the OP is looking for.

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 21 '05 #5

"Michael Winter" <M.******@blueyonder.co.invalid> wrote in message
news:opsgi5triix13kvk@atlantis...
On Wed, 27 Oct 2004 13:09:16 +0200, Markus Ernst <derernst@NO#SP#AMgmx.ch>
wrote:

[snip]
This is a Javascript task, so if you need more help you will find it in
a Javascript group. This will be small and clean.
Actually, the OP was directed from c.l.js because this would be better
handled with CSS. As Pierre suggested, something like:

.required {
background-color: #ff9f9f;
color: #000000;
}

<input class="required" ...>

would be more appropriate.


It would also be a static solution. He's asking for a dynamic solution,
where the appearance of the page changes depending on the user's initial
interactions. If someone directed him here from c.l.js, it must be because
he didn't understand this.
There is no way to change CSS properties of a group of fields globally
but changing them via Javascript.


On some arbitrary run-time trigger, no there isn't, but I don't think
that's what the OP is looking for.


It's exactly what the OP said he was looking for. "At the beginning of my
form I use a set of radio buttons to determine how to validate the form as
well as determine what fields are required. Because the form is so lengthy,
I would like to aid users by including visual clues as to what fields
require information by changing the background color of that field to red."

Jul 21 '05 #6
[Cross-posted to c.l.js. Follow-ups set to c.l.js.]

On Wed, 27 Oct 2004 09:57:07 -0400, Harlan Messinger
<h.*********@comcast.net> wrote:
"Michael Winter" <M.******@blueyonder.co.invalid> wrote in message
news:opsgi5triix13kvk@atlantis...
[snip]
[...] something like:

.required {
background-color: #ff9f9f;
color: #000000;
}

<input class="required" ...>

would be more appropriate.


It would also be a static solution.


To a certain extent, yes. Scripting could alter the class attribute
dynamically, but in that case, it would be best done entirely dynamically
(unless Chris' suggestion was used).
He's asking for a dynamic solution, where the appearance of the page
changes depending on the user's initial interactions.
To be honest, I didn't read the entire original post, just the follow-up
in c.l.js that sent the OP here. I should have.
If someone directed him here from c.l.js, it must be because he didn't
understand this.


Perhaps. You'd have to ask that person.

[Changing CSS rules]
On some arbitrary run-time trigger, no there isn't, but I don't think
that's what the OP is looking for.


It's exactly what the OP said he was looking for.


Then my mistake. I assumed the direction to ciwas was correct.

The optimum solution would depend on the structure of the form.

To the OP: do you have a URL to demonstrate the form?

[snip]

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 21 '05 #7
Markus Ernst wrote:
MA********@cox.net wrote:
At the beginning of my form I use a set of radio buttons to
determine how to validate the form as well as determine what fields
are required.

Rather that write a big messy function which declares
(document.form.name.style.backgroundColor='red') for every single
field, I'd like to be able to broadcast this command to several
chosen fields at once.

Put the names of the required fields into an array and loop through
it to execute your above statement.


My recommendation: change the *class* through js, not the style. Use
external css to set up display rules for the various classes.
This is a Javascript task, so if you need more help you will find it
in a Javascript group.
Agreed.
There is no way to change CSS properties of a group of fields
globally but changing them via Javascript.


You can change appearances based on class, though. And it would keep the
presentation in one place -- an external css file -- while keeping the
dynamic stuff in another place -- an external js file.

--
Brian (remove "invalid" to email me)
Jul 21 '05 #8
"Harlan Messinger" <h.*********@comcast.net> a écrit dans le message de
news:2u*************@uni-berlin.de
It would also be a static solution. He's asking for a dynamic
solution

(...)

Well I think mutch information is required to give any adapted answer...

Jul 21 '05 #9
Everyone, thanks for your help!

I ended using a combination of Java and CSS to accomplish this task. See my
OP and follow-ups on comp.lang.javascript if interested.

Best Regards

Martin

"Brian" <us*****@julietremblay.com.invalid> wrote in message
news:5g*********************@bgtnsc04-news.ops.worldnet.att.net...
Markus Ernst wrote:
MA********@cox.net wrote:
At the beginning of my form I use a set of radio buttons to
determine how to validate the form as well as determine what fields
are required.

Rather that write a big messy function which declares
(document.form.name.style.backgroundColor='red') for every single
field, I'd like to be able to broadcast this command to several
chosen fields at once.

Put the names of the required fields into an array and loop through
it to execute your above statement.


My recommendation: change the *class* through js, not the style. Use
external css to set up display rules for the various classes.
This is a Javascript task, so if you need more help you will find it
in a Javascript group.


Agreed.
There is no way to change CSS properties of a group of fields
globally but changing them via Javascript.


You can change appearances based on class, though. And it would keep the
presentation in one place -- an external css file -- while keeping the
dynamic stuff in another place -- an external js file.

--
Brian (remove "invalid" to email me)

Jul 21 '05 #10

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

Similar topics

7
by: Bil Muh | last post by:
Esteemede Developers, I would like to Thank All of You in advance for your sincere guidances. I am developing a software using Visual C++ .NET Standard Edition with Windows Form (.NET)...
1
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to...
1
by: mtech1 | last post by:
Access 2002 I am trying to create a dynamic crosstab report that parameters come from 3 different forms. I get runtime error 3070 - The Microsoft Jet database engine does not recognize...
3
by: MikeY | last post by:
Hi Everyone, I am working in C#, windows forms.My question is this. All my button dynamic controls properties are present and accounted for except for the"FlatStyle" properties. I can't seem to...
7
by: AdeelAlvi | last post by:
iam working on a project called service desk that automates the departmental services online .one major component i have to create is that to convert paper based forms into dynamic webforms . i...
2
by: deejayquai | last post by:
Hi I'm trying to produce a report based on a dynamic crosstab. Ultimately i'd like the report to actually become a sub report within a student end of year record of achievement. The dynamic...
3
by: RahimAsif | last post by:
I am writing an application that requires the a portion of the main menu to be dynamic. The menu has file, panels, view files and help across the top. The view files sub menu needs to be...
5
by: matt | last post by:
hello, i am on an interesting project. in this project, i have to create dynamic data-entry forms for offline-users to fill out, save locally, and eventually postback to our app (when back...
0
by: JamesOo | last post by:
I have the code below, but I need to make it searchable in query table, below code only allowed seach the table which in show mdb only. (i.e. have 3 table, but only can search either one only,...
2
by: yomadhu | last post by:
I created a dynamic form in javascript. Am unable to get those values in to php to display. I need all details. If i add 10 rows the i need to display those all values. Can any one help me for that...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.