473,948 Members | 21,059 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1830
David wrote on 14 mei 2007 in comp.lang.javas cript:
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.nam e,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.getEle mentById('myEle ment').style.di splay =
(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.getEle mentById('myEle ment').style.di splay =
(hide) ?'none' :'block';
I do not understand how that works.

I use to do :

document.getEle mentById('myEle ment').style.di splay =
document.getEle mentById('myEle ment').style.di splay==''?
'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...@sc ene-double.co.ukwro te:
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.getEl ementById('myEl ement').style.d isplay = (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.getEle mentById('myEle ment').style.di splay =
document.getEle mentById('myEle ment').style.di splay==''?
'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.javas cript:
Evertjan. a écrit :
>>
document.getEl ementById('myEl ement').style.d isplay =
(hide) ?'none' :'block';

I do not understand how that works.

I use to do :

document.getEle mentById('myEle ment').style.di splay =
document.getEle mentById('myEle ment').style.di splay==''?
'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.javas cript:
>Evertjan. a écrit :
>>document.getE lementById('myE lement').style. display =
(hide) ?'none' :'block';
I do not understand how that works.

I use to do :

document.getEl ementById('myEl ement').style.d isplay =
document.getEl ementById('myEl ement').style.d isplay==''?
'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.javas cript:
>Evertjan. a écrit :
>>document.getE lementById('myE lement').style. display =
(hide) ?'none' :'block';
I do not understand how that works.

I use to do :

document.getEl ementById('myEl ement').style.d isplay =
document.getEl ementById('myEl ement').style.d isplay==''?
'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.javas cript:
>Evertjan. a écrit :
>>document.getE lementById('myE lement').style. display =
(hide) ?'none' :'block';
I do not understand how that works.

I use to do :

document.getEl ementById('myEl ement').style.d isplay =
document.getEl ementById('myEl ement').style.d isplay==''?
'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.javas cript:
Evertjan. a écrit :
>ASM wrote on 15 mei 2007 in comp.lang.javas cript:
>>Evertjan. a écrit :
document.get ElementById('my Element').style .display =
(hide) ?'none' :'block';
I do not understand how that works.

I use to do :

document.getE lementById('myE lement').style. display =
document.getE lementById('myE lement').style. display==''?
'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.wordreferen ce.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

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

Similar topics

1
4210
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 in IE as well as FireFox. This code has been tested on a Win2003 server, IIS6, PHP 5.0.3, mySQL 4.1.8 and it works fine. The problem server is a Win2k server, IIS5, PHP 5.0.4, mySQL 4.1.11.
1
4371
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 dropdowns and hitting the 'Search' button. The first column returned is a user name and is added to the panel as a label, the second is a number and is added to the label as the text property of a textbox, so the user can update it. When the...
4
3533
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 click a button on a pop-up window the javascript for that button click does a 'button.form.submit'. On the Server side there is a Button click event for this button, but for some reason it no longer fires. It worked fine before and everything...
12
1585
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 table. I want to enter a number into the text box and using this number determine if there is a record in the table with a primary key that matches it.
0
1132
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, updating private shared variables. When it finishes updating, it raises a NewData event. My app responds to that event by updating display controls (labels in this case). I have to use a delegate and update them like this: Private Sub...
1
2555
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 characters are correct in database too. but when I want to search a user in my asp search form, the "not found" phrase displayed! any keyword I use to search like username or name or city will fail. but when I edit the user profile with my asp edit...
3
2854
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 really apart from the common knowledge stuff i.e. the send email to etc, but this wasn't designed by me so I am unsure if it's wrong or right.. If someone could let me know whether there's a problem with the code or if the problem may lay elsewhere...
4
2581
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 textarea on the form. If only a short text is entered it works fine. I have increased the post_max_size from 8M to 200M but this has not helped. I have googled for an answer but have been unable to find one.
5
3008
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 hours on this and couldn't find the solutions, thats why I have to come with a hack. I have two forms, I made the first form invisible and let the second form visible.This form is for google custom search engine. I also tried with other test forms, but...
0
10165
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
11179
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...
0
10694
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9898
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
8256
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
7431
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6339
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4541
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3547
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.