944,083 Members | Top Members by Rank

Ad:
Aug 22nd, 2005
0

Javascript form managment on the fly!

Expand Post »
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
Similar Threads
Reputation Points: 13
Solved Threads: 2
Junior Poster in Training
Sailor_Jerry is offline Offline
88 posts
since Aug 2005
Aug 22nd, 2005
0

Re: Javascript form managment on the fly!

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';
Reputation Points: 20
Solved Threads: 5
Junior Poster
alpha_foobar is offline Offline
182 posts
since May 2005
Aug 23rd, 2005
0

Re: Javascript form managment on the fly!

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>
Reputation Points: 13
Solved Threads: 2
Junior Poster in Training
Sailor_Jerry is offline Offline
88 posts
since Aug 2005
Aug 23rd, 2005
0

Re: Javascript form managment on the fly!

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.
Reputation Points: 13
Solved Threads: 2
Junior Poster in Training
Sailor_Jerry is offline Offline
88 posts
since Aug 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JavaScript / DHTML / AJAX Forum Timeline: How to make javascript form autochange - "Onchange"?
Next Thread in JavaScript / DHTML / AJAX Forum Timeline: Drag and Drop





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC