Hello,
I have a working Show / Hide form, that works on FF, but what I would
like to do is to be able to display one part when a user clicks on one
radio button and display another part when the user clicks on the
second radio button - here is the code which just shows / hides the
whole form:
<script type="text/javascript">
<!--
var dl_elements = new Array('dl_address_country',
'dl_address_region',
'dl_address_county',
'dl_address_uk_region');
function show_creation_form() {
for (i=0; i < dl_elements.length; i++) {
element_id = dl_elements[i];
element= document.getElementById(element_id);
element.style.visibility = 'visible';
}
}
function hide_creation_form() {
for (i=0; i < dl_elements.length; i++) {
element_id = dl_elements[i];
element = document.getElementById(element_id);
element.style.visibility = 'hidden';
}
}
-->
</script>
<!-- This form is for the UK only -->
<dl id="dl_address_uk_region">
<dt><label for="company_region">Region</label></dt>
<dd>
<select name="company_region">
<option value="">[Select One]</option>
<optgroup stl:repeat="region create_form/regions"
label="${region/label}">
<option stl:repeat="county region/counties"
value="${county/id}">${county/label}</option>
</optgroup>
</select>
</dd>
</dl>
<!-- This form is for the UK only -->
<!-- Non UK States, teritories or provinces form starts here -->
<dl id="dl_address_country">
<dt><label for="address_country">Country</label></dt>
<dd>
<input size="40" name="address_country" />
</dd>
</dl>
<dl id="dl_address_region">
<dt><label for="address_region">Region/State</label></dt>
<dd>
<input size="40" name="address_region" />
</dd>
</dl>
<dl id="dl_address_county">
<dt><label for="address_county">County</label></dt>
<dd>
<input size="40" name="address_county" />
</dd>
</dl>
So, what I would like is that if a User clicks on the UK - radio
button only the first part of the form is shown and hide the second
part and vice a versa, when a User clicks on Non - UK radio button the
second part of the form is show and the first is hidden.
Any advise will be much appreciated.
Many thanks
Norman 6 4177
I haven't got time to go through your code but here's how I did it a
few days ago
markup (I couldn't get it to work with the onclick in an external js
file for some reason):
<input type="radio" name="gymspashop" id="gymspashop" value="Gym"
checked="checked" onclick="Radio(this);"Gym
<input type="radio" name="gymspashop" id="gymspashop" value="Spa"
onclick="Radio(this);"Spa
js:
function analyseRadio(rad) {
if (rad.value == "Spa") {
document.getElementById('contactcontext-spa').style.display = "block"
document.getElementById('contactcontext-gym').style.display = "none"
}
etc
}
spot the typo. should read onclick="analyseRadio(this)
On Feb 20, 3:09 pm, brough...@gmail.com wrote:
spot the typo. should read onclick="analyseRadio(this)
Hi thanks for your reply, but I couldn't get it to work...
Do I need to give the id=contactcontext-spa or contactcontext-gym for
the differnt input values, please if you can send me the full example.
Cheers
Norman
PS Also, I found http://www.quirksmode.org/dom/usableforms.html, could
be of help...
On 20 Feb, 09:49, "Norman" <norman.kh...@gmail.comwrote:
On Feb 20, 3:09 pm, brough...@gmail.com wrote:
spot the typo. should read onclick="analyseRadio(this)
Hi thanks for your reply, but I couldn't get it to work...
Do I need to give the id=contactcontext-spa or contactcontext-gym for
the differnt input values, please if you can send me the full example.
example here: http://tinyurl.com/37fbhj
did I just paste the wrong tinyurl... http://tinyurl.com/37fbhj
assign each radio button a unique value -- this value will be passed
on by the onclick event to the radio() function. As the radio buttons
themselves are an array each shares the same name and id.
the div 'contactcontext-spa' in this example is the name of the div
that is to be revealed or hidden.
On Feb 20, 5:40 pm, brough...@gmail.com wrote:
did I just paste the wrong tinyurl...
http://tinyurl.com/37fbhj
assign each radio button a unique value -- this value will be passed
on by the onclick event to the radio() function. As the radio buttons
themselves are an array each shares the same name and id.
the div 'contactcontext-spa' in this example is the name of the div
that is to be revealed or hidden.
Thanks for your help, I got it to work ;) This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: genetic.error |
last post by:
I'm moving from Vb6 to VB.Net. I have a feeling this has come up
before...
The VS.Net MSDN file seems to state that the following should work:
Form1.Show
Form1.Visible = True
Form1.Hide...
|
by: Ajai Kumar .R |
last post by:
Hai all,
I've two or more forms on my app.
My requirement is, Have to show the first form asa the user press a button
have to hide the first form and show the second form. If the user press the...
|
by: sergio |
last post by:
Hi all,
I have created the following script that will show/hide a menu based on
checkboxes. It works fine in Opera but not on IE6!
Does anybody knows a workaround this problem?
Thanks for your...
|
by: Nathan |
last post by:
I read an earlier post from Gary and answered by Peter Huang concerning
closing one form and showing another. I need to do the same thing in my
application, but the code Peter gave didn't work for...
|
by: Tim Smallwood |
last post by:
Hi,
This is probably a stupid question, but I can't seem to get a form to
show / load? In the older versions of VB I'd use frmMyform.show / load
myForm, etc? I looked at the help file and it...
| |
by: Mac via DotNetMonster.com |
last post by:
I have a MDI parent form and the only control on it is a panel anchored to
the left hand side. I have menu items on the MDI parent that show & hide
this panel. Ideally I would like it to show by...
|
by: question |
last post by:
Hi!
I have a requirement where I need to display multiple forms one after
the other like a slide show. These are in the same application.
Basicall on selection of a menu item it should start...
|
by: ali |
last post by:
Hello every one
i need you help regarding div hide and show. i am having a link like
<a href="#" onClick="expandWin()">show/hide </a>
<div id=showHide>
</div>
within div i have lots of...
|
by: pamate |
last post by:
hi,
I want to show hide layers. I am able to show and hide layers but i am facing problem that, cant view the cursor in Mozilla,but i can type in input text box, its overlapping the layers.
...
|
by: oranoos3000 |
last post by:
hi
would you please help me
i have a online shopping center that i show pictures of the my product in home page.
in the InterExplorer pictures is shown correctly but in Firefox browser is shown...
|
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,...
| |
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...
|
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: 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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |