Javascript form managment on the fly!

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Aug 2005
Posts: 75
Reputation: Sailor_Jerry is an unknown quantity at this point 
Solved Threads: 2
Sailor_Jerry's Avatar
Sailor_Jerry Sailor_Jerry is offline Offline
Junior Poster in Training

Javascript form managment on the fly!

 
0
  #1
Aug 22nd, 2005
Is there a way using javascript to change the display of a form after it as been rendered?

I won’t to remove a checkbox on a form if a certain condition is true.

Since this case is not the norm, the default rendering displays the checkbox even though it’s not a valid selection.

And the check I guess would have to come when the link to display the form is clicked.

Any ideas??


Thanks
Reply With Quote Quick reply to this message  
Join Date: May 2005
Posts: 182
Reputation: alpha_foobar is an unknown quantity at this point 
Solved Threads: 3
alpha_foobar's Avatar
alpha_foobar alpha_foobar is offline Offline
Junior Poster

Re: Javascript form managment on the fly!

 
0
  #2
Aug 22nd, 2005
you can use the style property 'display' to show/hide elements in your web page. Its pretty simple, if you give content that you want to manipulate an id:

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. // to hide
  2. document.getElementById("yourDivOrElementId").style.display = 'none';
  3.  
  4. // to show
  5. document.getElementById("yourDivOrElementId").style.display = 'block';
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 75
Reputation: Sailor_Jerry is an unknown quantity at this point 
Solved Threads: 2
Sailor_Jerry's Avatar
Sailor_Jerry Sailor_Jerry is offline Offline
Junior Poster in Training

Re: Javascript form managment on the fly!

 
0
  #3
Aug 23rd, 2005
Thanks that worked for input element. Is there a way to hide elements that don't have an id? I have a label for the input element that looks like this
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. <label for"sameIDasInput">LableText</label>
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 75
Reputation: Sailor_Jerry is an unknown quantity at this point 
Solved Threads: 2
Sailor_Jerry's Avatar
Sailor_Jerry Sailor_Jerry is offline Offline
Junior Poster in Training

Re: Javascript form managment on the fly!

 
0
  #4
Aug 23rd, 2005
I just put everything that needed to be modified on the fly between a div tag like so
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. <div ID="test0" style="visibility:visible">

With the visibility set.

I used javascript to update the visibility.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC