473,387 Members | 1,585 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,387 software developers and data experts.

Hidden tables and form

Hi everybody
in this page http://www.promoexpo.it/new/form_prova.htm
i have a form with hidden tables. When i send the form, the values of the
select that are in the table are sent even if the table is hidden.
How can i do to send the values only when the table is visible?
Thanks and sorry for my english!

Aug 3 '05 #1
4 1348
Nduul wrote:
Hi everybody
in this page http://www.promoexpo.it/new/form_prova.htm
i have a form with hidden tables. When i send the form, the values of the
select that are in the table are sent even if the table is hidden.
How can i do to send the values only when the table is visible?
Thanks and sorry for my english!


When you change the the table to visible or hidden, also change the
select's disabled attribute to false or true respectively.

--
Rob
Aug 3 '05 #2

"RobG" <rg***@iinet.net.auau> ha scritto nel messaggio
news:42***********************@per-qv1-newsreader-01.iinet.net.au...
When you change the the table to visible or hidden, also change the
select's disabled attribute to false or true respectively.

can you explain me how to do with the script of that page? I have many
select in each table
thanks
Aug 3 '05 #3
Nduul wrote:
"RobG" <rg***@iinet.net.auau> ha scritto nel messaggio
news:42***********************@per-qv1-newsreader-01.iinet.net.au...
When you change the the table to visible or hidden, also change the
select's disabled attribute to false or true respectively.

can you explain me how to do with the script of that page? I have many
select in each table
thanks


Firstly validate your page, it has very old and depreciated code.

Here's your script with comments inserted:
<script language="JavaScript">
The language attribute is depreciated, type is required
<!--
HTML comments inside script tags are totally out of date, do not use them.
function visualizza(quale) {
document.getElementById('tabella'+quale.name).styl e.display =
(quale.checked?"inline":"none");
Break up long lines, if only for readability and test features before
trying to use them.

When using the display attribute to hide or show parts of a table,
switch between '' and 'none'. '' will return the table to it's
default or whatever has been set in CSS somewhere - it almost
certainly should not be 'inline'.

You should also test to ensure features are supported before
attempting to use them - in this case, getElementById and the style
object. Read the FAQ if you need some help with supporting older
browsers.

<URL:http://www.jibbering.com/faq/>
}
//-->
Ditch comments.
</script>


Below is your script tidied up. There's an extra function that will
disable any input control in the table - if you add other types of
control, you'll need to accommodate them too. I've made an assumption
that if getElementById is supported, then so is getElementsByTagName.

But you still have a usability issue - when the page loads, your
checkboxes are unchecked. When they are first checked, the script
makes them visible so nothing appears to happen. Only when they are
unchecked again do they disappear.

I'll leave fixing that (and other related issues) to you.
<script type="text/javascript">

function visualizza(quale) {
if ( document.getElementById ) {
var t = document.getElementById( 'tabella' + quale.name );
if ( t.style ) {
if ( quale.checked ) {
t.style.display = '';
disableControls( f, false );
} else {
t.style.display = 'none';
disableControls( f, true );
}
}
}
}

function disableControls( f, flag ) {
var fc = f.getElementsByTagName('input');
for (var i=0, j=cont.length; i<j; i++ ){
fc[i].disabled = flag;
}
}
</script>

--
Rob
Aug 3 '05 #4

"RobG" <rg***@iinet.net.auau> ha scritto nel messaggio
news:42***********************@per-qv1-newsreader-01.iinet.net.au...

I'll leave fixing that (and other related issues) to you.
<script type="text/javascript">

cut

Thanks for yours suggestions Rob; i'm not a programmer (as you can see), but
a designer.
I only want to make a little bit of order in a page with a lot of select
and checkbox.
I'll try to fix the remaining issues
Thanks for your help
Aug 3 '05 #5

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

Similar topics

1
by: mark.reichman | last post by:
First off.. Thanks to Grant Wagner for help in a previous thread related to this one. I am at a total loss... I have multiple fields in a form with the same name. Lets call the fields with the...
6
by: Saqib Ali | last post by:
I have created a slider using Javascript and html tables that generally works very well. As you move the "knob" to the right, a numeric value in an adjactent <INPUT type="text"> tag increases....
2
by: Jon | last post by:
Hi all, I am trying to create a page that contains a number of div elements, with links on the left side of the page allowing the user to select which div to display. Some of the pages contain...
1
by: Sam Wuebben | last post by:
I would like to add a few hidden field values to a form as it is submited via JavaScript. I have a static page shopping site that uses MIVA shopping cart. Some of the pages are getting quite...
10
by: Mark McLellan | last post by:
Dear all Following the oft-repeated advice here and ciwas I have made my site nearly 4.01 strict (working on it). There are some items on which I would appreciate your advice: 1. Hidden...
5
by: dixie | last post by:
If I sent a user an empty database container - dB with no tables and I needed them to import their tables into it and one of their tables was a hidden table with the prefix Usys, is there any way...
1
by: Graham Charles | last post by:
I'm trying to create a standard "hidden" table. However, using this code, my tables are not displayed in the database window *even* when I choose to show Hidden and System objects from the Options...
1
by: pemigh | last post by:
I'm almost done with an application, and trying to lock it down tightly. But I still want users to be able to point to a new location for the data file. The code below fires off to detect and...
3
by: KNN | last post by:
Hi I have some tables with hidden attribute set to 1. In the query desgn view , I do not see these tables as expected. But, If I choose the query wizard to create a new query, then i do see...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.