CodeChargeMVP
Posts: 473
|
| Posted: 05/25/2010, 9:04 AM |
|
Hello,
i should resolve the next issue:
When on change from a listbox = X, some text field should appear
¿How´s the best way to do this?
I´ve use the before show to hide the field but when i try to get access to it on javascript
obviously i get undefined value cause it doesn´t exist, ¿what´s my mistake?
Thank you very much in advance.
_________________
Best Regards
Entrepeneur | NT Consultant
|
 |
 |
pschmid0
Posts: 8
|
| Posted: 05/26/2010, 6:03 AM |
|
Try doing this outside of CodeCharge Studio and do it using javascript and CSS. For your listbox, you will still have your Client event onchange as custom code. You can Google for how to do the javascript and CSS. I usually use a div around the object (in your case text) and show/hide that div.
Hope that helps.
Paul
|
 |
 |
CodeChargeMVP
Posts: 473
|
| Posted: 05/27/2010, 6:20 AM |
|
Hello Paul,
Your solution has sense since hiding a div which involve an object seems to be the most
obviously, but I still haven´t very update with CSS so by the way we gonna try to offer other solution
to the customer which i´m able to develop doing than the list box activate and desactivate
depending on the value of other list box.
By the way i´m more focused on javascript,php and mysql, but i already got the books from
html,xhtml and css so i hope to be able to develop this solution in the next months.
Quote pschmid0:
Try doing this outside of CodeCharge Studio and do it using javascript and CSS. For your listbox, you will still have your Client event onchange as custom code. You can Google for how to do the javascript and CSS. I usually use a div around the object (in your case text) and show/hide that div.
Hope that helps.
Paul
_________________
Best Regards
Entrepeneur | NT Consultant
|
 |
 |
ccard
Posts: 6
|
| Posted: 05/28/2010, 12:13 AM |
|
Hi:
On the OnLoad Event in the client side from your page you put something like this:
document.getElementById("textfield").disabled = true;
In the OnChange (client side) from your list box you put something like this:
var lbox = document.getElementById("your_listbox");
var vbox = lbox.options[lbox.selectedIndex].value;
if( vbox == 1 ) // Here you put all the values to activate
{
document.getElementById("textfield").disabled = false;
}
else
{
document.getElementById("textfield").disabled = true;
}
You can put a the textfield in a div and instead of disable the textfield, hide the div.
Bye.
_________________
---------
ccard
--------- |
 |
 |
|