C
cschang
In my vb.net module, I used the script to generate a client side
javascript function. as
Private Sub disablePostedFileInout(ByVal n As Integer)
Dim jScript As String
jScript = "<script language='javascript'>"
jScript = jScript & " function disableInput(" & n & " ) { "
jScript = jScript & " var j = 0; "
jScript = jScript & " for( var i =0; i<
document.form1.elements.length; i++){"
jScript = jScript & " if( document.form1.elements.type
=='file') { "
jScript = jScript & "
document.form1.elements.style.visibility = 'hidden'; "
jScript = jScript & " if ( (j + 1) == " & n & " ) return; "
jScript = jScript & " } ) } "
jScript = jScript & "</script>"
If (Not IsClientScriptBlockRegistered("clientScript")) Then
RegisterClientScriptBlock("clientScript", jScript)
End If
End Sub
Is possible I can just call the javascript function "disableInput"
without associating it in any event of the control such as button or
input as some kind of onclick, onchange etc? I want to run it from
another sub of the module
C Chang
javascript function. as
Private Sub disablePostedFileInout(ByVal n As Integer)
Dim jScript As String
jScript = "<script language='javascript'>"
jScript = jScript & " function disableInput(" & n & " ) { "
jScript = jScript & " var j = 0; "
jScript = jScript & " for( var i =0; i<
document.form1.elements.length; i++){"
jScript = jScript & " if( document.form1.elements.type
=='file') { "
jScript = jScript & "
document.form1.elements.style.visibility = 'hidden'; "
jScript = jScript & " if ( (j + 1) == " & n & " ) return; "
jScript = jScript & " } ) } "
jScript = jScript & "</script>"
If (Not IsClientScriptBlockRegistered("clientScript")) Then
RegisterClientScriptBlock("clientScript", jScript)
End If
End Sub
Is possible I can just call the javascript function "disableInput"
without associating it in any event of the control such as button or
input as some kind of onclick, onchange etc? I want to run it from
another sub of the module
C Chang