1

I'm using Ultrawebgrid for my applcation:

I'm using a textarea for listing the errors in my application in the row template when the user clicks that particular row...

So I need to have texarea when there are any errors..... otherwise when there are no errors i dont even want the row_template to pop up..... I'm using IE6.

I'm checking if there are any errors using javascript.so I had to use the javascript event handler:: UltraWebGrid1_BeforeRowTemplateOpenHandler(gridName, rowId, templateId)

where in I write the statements given below: document.getElementById("TextArea2").style.visibility="collapse" inside the above event function

1) it's showing javascript error as "Couldnot get the visibility property:Invalid Argument" but the row template does not pop up....... only the error's coming....

2) Is there any code to block the row template when there are no errors.?? i mean no pop_up for no errors

What's the solution for this???

stack_pointer is EXTINCT
  • 2,263
  • 12
  • 49
  • 59
  • When you say you want it to be invisible do you want it to still take up layout space or for the page to collapse? If the former then Greg has the right answer if the latter then tvanfosson does. – annakata May 12 '09 at 11:49
  • Can some1 reply to this???? it's urgent. I dont c any reply for my questions involving 'Ultrawebgrid' as one of the tags. !!! – stack_pointer is EXTINCT May 12 '09 at 12:55

4 Answers4

5

DISPLAY

Use display instead of visibility. This occupies no space in your document.

document.getElementById("TextArea2").style.display = 'none';    // Turn off    
document.getElementById("TextArea2").style.display = 'inline';  // Turn on

VISIBILITY

document.getElementById("TextArea2").style.visibility="hidden";    // Turn off
document.getElementById("TextArea2").style.visibility="visible";    // Turn on

By using the above code textarea won't be visible, but there will be blank space in your document having the height and width of the textarea.

Also 'collapse' value is supported only in Internet Explorer 8

rahul
  • 184,426
  • 49
  • 232
  • 263
3

Try using:

document.getElementById("TextArea2").style.display = 'none';

and (to turn it back on again)

document.getElementById("TextArea2").style.display = 'block'; // or 'inline'
tvanfosson
  • 524,688
  • 99
  • 697
  • 795
  • Textarea is an inline element. So no need to use display block. – rahul May 12 '09 at 12:18
  • 1
    If I were displaying error messages I wouldn't want it to display inline. Of course, I'd probably display in them in a DIV or SPAN, too. – tvanfosson May 12 '09 at 13:26
  • I'd have done it with class modification to separate CSS and JS concerns, but I'd def go with block for the reasons above – annakata May 12 '09 at 15:14
1

You want:

document.getElementById("TextArea2").style.visibility = "hidden";

"collapse" is not a valid value for the visibility property in IE6, as your error message indicates.

Alternatively as suggested by @tvanoffsen you could set the display property to "none". This has a slightly different effect - it will not take up any space if set to "display: none", whereas setting "visibility: hidden" still takes up space.

Greg
  • 316,276
  • 54
  • 369
  • 333
  • @Greg -- I was anticipating the next question -- how do I get rid of the blank space where the textarea was? :-) – tvanfosson May 12 '09 at 11:50
  • Collapse is a valid value ( http://www.w3.org/TR/CSS2/visufx.html#visibility ) but (it would appear) unsupported in IE6. – Quentin May 12 '09 at 12:10
-1

use visible and hidden for .style.visibility attribute not block and hidden. it works.

Shans
  • 1