473,399 Members | 3,106 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,399 software developers and data experts.

Difficult form problem - updating a text box for search

Hi,

I am trying to achieve the following:

1/ To have a standard form in an asp web page which has various
check boxes and radio buttons.
As a user selects a form item it updates a text box, of which the
contents are submitted to a search page. I know I could just send the
form element data to a search page, but in this app, the user is
creating a product code and need to see the complete code before it is
search on.

Is there a way to add/delete text from a text box as form elements are
selected / un-selected

_____________

2/ Also, what is the best way to hide / unhide form elements when
others are selected ?

Thanks in advance
David

May 14 '07 #1
12 1769
David wrote on 14 mei 2007 in comp.lang.javascript:
Hi,

I am trying to achieve the following:

1/ To have a standard form in an asp web page which has various
check boxes and radio buttons.
As a user selects a form item it updates a text box, of which the
contents are submitted to a search page. I know I could just send the
form element data to a search page, but in this app, the user is
creating a product code and need to see the complete code before it is
search on.

Is there a way to add/delete text from a text box as form elements are
selected / un-selected
<input type='checkbox' onclick ='doIt(this.name,this.checked)' name='..'
<input type='radio' onclick =' ...
_____________

2/ Also, what is the best way to hide / unhide form elements when
others are selected ?
There is no "best" way in programming.

Try:

document.getElementById('myElement').style.display =
(hide) ?'none' :'block';

========

Please show your code, minimalistic that is.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
May 14 '07 #2
ASM
Evertjan. a écrit :
>
document.getElementById('myElement').style.display =
(hide) ?'none' :'block';
I do not understand how that works.

I use to do :

document.getElementById('myElement').style.display =
document.getElementById('myElement').style.display ==''?
'none' : '';

--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
May 14 '07 #3
On May 14, 10:28 pm, David <davidgor...@scene-double.co.ukwrote:
Hi,

I am trying to achieve the following:

1/ To have a standard form in an asp web page which has various
check boxes and radio buttons.
As a user selects a form item it updates a text box, of which the
contents are submitted to a search page. I know I could just send the
form element data to a search page, but in this app, the user is
creating a product code and need to see the complete code before it is
search on.

Is there a way to add/delete text from a text box as form elements are
selected / un-selected
not unless you code it yourself what have you tried.
heres how I would do it:
you take the value of the element and add it to the end of the text
box value and put it inside an array.
if they then click on a few things and then remove something they had
previously added, you must take the position of the element in the
array with the value just removed (which must be unique) and remove
the appropriate string from the position it will be in the text box
after adding together the string lengths of the values that were
before that element in the array.

>
_____________

2/ Also, what is the best way to hide / unhide form elements when
others are selected ?

have two classes called hide and show
these have display:none, and display:block
set the classNames of elements according to what is clicked, if you
need multiple things to appear dissappear either use a div surrounding
them, or set a function to take an array of element names and show/
hide them.
remember to check what state they are in before you act on them if you
have any overlap between single and groups of elements

>
Thanks in advance

David

May 15 '07 #4
ASM wrote:
Evertjan. a écrit :
>>
document.getElementById('myElement').style.displa y = (hide) ?'none'
:'block';

I do not understand how that works.
You did not misunderstand anything. It does not work as is.
I use to do :

document.getElementById('myElement').style.display =
document.getElementById('myElement').style.display ==''?
'none' : '';
Same thing I do. Well, basically. I still explicitly set 'block' or
'inline' or whatever for that matter. Only to make sure it is set back
to its original style.

--
-Lost
Remove the extra words to reply by e-mail. Don't e-mail me.
I am kidding. No I am not.
May 15 '07 #5
ASM wrote on 15 mei 2007 in comp.lang.javascript:
Evertjan. a écrit :
>>
document.getElementById('myElement').style.displa y =
(hide) ?'none' :'block';

I do not understand how that works.

I use to do :

document.getElementById('myElement').style.display =
document.getElementById('myElement').style.display ==''?
'none' : '';
That is a toggle, 'hide' returns any boolean result.

A toggle was not asked for, Stéphane.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
May 15 '07 #6
ASM
Evertjan. a écrit :
ASM wrote on 15 mei 2007 in comp.lang.javascript:
>Evertjan. a écrit :
>>document.getElementById('myElement').style.displ ay =
(hide) ?'none' :'block';
I do not understand how that works.

I use to do :

document.getElementById('myElement').style.displa y =
document.getElementById('myElement').style.displa y==''?
'none' : '';

That is a toggle, 'hide' returns any boolean result.
Erreur : hide is not defined
told me my FF
(far from to switch something)
A toggle was not asked for, Stéphane.
Je ne comprends rien à cette phrase.
(don't understand this sentence, and inline translators not more)
--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
May 15 '07 #7
ASM
Evertjan. a écrit :
ASM wrote on 15 mei 2007 in comp.lang.javascript:
>Evertjan. a écrit :
>>document.getElementById('myElement').style.displ ay =
(hide) ?'none' :'block';
I do not understand how that works.

I use to do :

document.getElementById('myElement').style.displa y =
document.getElementById('myElement').style.displa y==''?
'none' : '';

That is a toggle, 'hide' returns any boolean result.
Erreur : hide is not defined
told me my FF
(far from to switch something)
A toggle was not asked for, Stéphane.
Je ne comprends rien à cette phrase.
(don't understand this sentence, and inline translators not more)
--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
May 15 '07 #8
ASM
Evertjan. a écrit :
ASM wrote on 15 mei 2007 in comp.lang.javascript:
>Evertjan. a écrit :
>>document.getElementById('myElement').style.displ ay =
(hide) ?'none' :'block';
I do not understand how that works.

I use to do :

document.getElementById('myElement').style.displa y =
document.getElementById('myElement').style.displa y==''?
'none' : '';

That is a toggle, 'hide' returns any boolean result.
Erreur : hide is not defined
told me my FF
(far from to switch something)
A toggle was not asked for, Stéphane.
Je ne comprends rien à cette phrase.
(don't understand this sentence, and inline translators not more)
--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
May 15 '07 #9
ASM wrote on 15 mei 2007 in comp.lang.javascript:
Evertjan. a écrit :
>ASM wrote on 15 mei 2007 in comp.lang.javascript:
>>Evertjan. a écrit :
document.getElementById('myElement').style.disp lay =
(hide) ?'none' :'block';
I do not understand how that works.

I use to do :

document.getElementById('myElement').style.displ ay =
document.getElementById('myElement').style.displ ay==''?
'none' : '';

That is a toggle, 'hide' returns any boolean result.

Erreur : hide is not defined
told me my FF
(far from to switch something)
Why should it be defined, It is not a complete code.

>
>A toggle was not asked for, Stéphane.

Je ne comprends rien à cette phrase.
(don't understand this sentence, and inline translators not more)
Tant pis pour vous.

Voi: <http://www.wordreference.com/enfr/toggle>
and inline translators not more)
Je ne comprends pas cette phrase.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
May 15 '07 #10
ASM
Evertjan. a écrit :
ASM wrote on 15 mei 2007 in comp.lang.javascript:
>Evertjan. a écrit :
>>ASM wrote on 15 mei 2007 in comp.lang.javascript:

Evertjan. a écrit :
document.getElementById('myElement').style.dis play =
(hide) ?'none' :'block';
I do not understand how that works.

That is a toggle, 'hide' returns any boolean result.
Erreur : hide is not defined
told me my FF
(far from to switch something)

Why should it be defined, It is not a complete code.
Ha? alors ... si ce n'est pas du code ...
>>A toggle was not asked for, Stéphane.
Je ne comprends rien à cette phrase.
(don't understand this sentence, and inline translators not more)

Tant pis pour vous.

Voi: <http://www.wordreference.com/enfr/toggle>
I understand what is toggle, but not the sens of the sentence.
(my poor english ...)
>and inline translators not more)

Je ne comprends pas cette phrase.
and web translators not more (understand sense of ...)
non plus que les traducteurs en ligne
pas plus que les traducteurs en ligne

example :
http://www.lexilogos.com/traduction_multilingue.htm

--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
May 16 '07 #11
ASM wrote on 16 mei 2007 in comp.lang.javascript:
Evertjan. a écrit :
>ASM wrote on 15 mei 2007 in comp.lang.javascript:
>>Evertjan. a écrit :
ASM wrote on 15 mei 2007 in comp.lang.javascript:

Evertjan. a écrit :
>document.getElementById('myElement').style.di splay =
>(hide) ?'none' :'block';
I do not understand how that works.
>
That is a toggle, 'hide' returns any boolean result.
Erreur : hide is not defined
told me my FF
(far from to switch something)

Why should it be defined, It is not a complete code.

Ha? alors ... si ce n'est pas du code ...
>>>A toggle was not asked for, Stéphane.
Je ne comprends rien à cette phrase.
(don't understand this sentence, and inline translators not more)

Tant pis pour vous.

Voi: <http://www.wordreference.com/enfr/toggle>

I understand what is toggle, but not the sens of the sentence.
(my poor english ...)
Peut-être:

Le poseur original n'a pas posé sa Q sur une function basculante.

"... 'hide' returns any boolean result"

.... 'hide' est une variable et retourne une valeur booléene.

>>and inline translators not more)

Je ne comprends pas cette phrase.

and web translators not more (understand sense of ...)
non plus que les traducteurs en ligne
pas plus que les traducteurs en ligne
C'est bon ça, le idiom done une "joie de vivre" aux lanques
heureusement incompréhensible aux traducteurs en ligne.

That completes my capacity of composing written French,
bad or worse, today (UTC).

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
May 16 '07 #12
ASM
Evertjan. a écrit :
ASM wrote on 16 mei 2007 in comp.lang.javascript:
>Evertjan. a écrit :
>>>>A toggle was not asked for, Stéphane.

Peut-être:

Le poseur original n'a pas posé sa Q sur une function basculante.
Ho? possibly, and then ?

Have we to answer exactly ? Can't we show other solution(s) ?

The OP asked :
2/ Also, what is the best way to hide / unhide form elements when
others are selected ?
a toggle could do the stuff,
a toggle was I thought you gave as code
(it was only suggested and answer's built was out of my understanding )
C'est bon ça, le idiom done une "joie de vivre" aux lanques
heureusement incompréhensible aux traducteurs en ligne.
They can gives some atrocities !
Curiously, a wrong result remade in good language and re-submited
can give back what was submited in first ...

--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
May 16 '07 #13

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

Similar topics

1
by: Michael Brennan-White | last post by:
If I submit my for using a get action the resulting page loads . If I use a post action I get an error page saying "The page cannot be found". I am calling the originating page!!! This happens...
1
by: sekisho | last post by:
I'm dynamically adding a column of labels and a column of text boxes to a panel on a webform, based on data returned from an SQL query, which the user builds by selecting options from a few...
4
by: John Boy | last post by:
Hi, Can anyone help. This is really doing my nut in. 3 years ASP exp. and now doing .DOT which is a step in the wrong direction. Basically I am left with the code of a guy who has left. When I...
12
by: RICHARD BROMBERG | last post by:
For the last couple of days I have been trying to learn how to solve this problem. I'm using Access 2000 I am posting it again and maybe I will be mofe successful. I have a text box and a...
0
by: =?Utf-8?B?YmFrZXJzaGFjaw==?= | last post by:
Unless my app is EXTREMELY simple, I get the cross-threading error message regularly when updating controls on a Windows form. My latest example involves a dll that runs a System.Threading.Timer,...
1
by: tamoochin | last post by:
I have a form that registers the user with my website, the form is in farsi language and must use utf-8 standard. I can store data in MS Access and also read it back with any problems. the...
3
by: jerry101 | last post by:
Okay, so I have no knowledge with ASP and I was asked to look at this contact form because the emails aren't delivering. I'll post the whole page of code, because I am unsure at what is what...
4
by: Puzzled | last post by:
PHP 4.4 and PHP 5.2.3 on ubuntu. I am running Moodle 1.5.3 and have recently had a problem when updating a course. The $_POST variable is empty but only if a lot of text was entered into the...
5
by: programmerboy | last post by:
I never had this kind of issue before and it is completely surprising. I have a usercontrol where I need 2 forms to make 1 form. When I have only 1 form it submits the page to itself. I have spent...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.