Alexander, it's still not clear.  Combining your two messages, I should
guess that the fieldstatus variable is assigned on the server, and
you're trying to run the LinkClick sub on the client?

If that's the case then

  a)  the client never gets fieldstatus, as you've discovered, and

  b)  why would you send down all the fieldstatus choices with the
client's LinkClick procedure when you know (on the server serving the
page) the value of fieldstatus?

It would be better to use Response.Write to send down only the code
LinkClick requires when the value of fieldstatus is X, as in

...
<%
If rstSearchResults.Fields ("Status").Value = "ACTIVE" then
  fieldstatus=1
End If
%>
...

' start writing out LinkClick here as you do now
Sub LinkClick()
 Dim strDis
 msgbox "YOU CLIKED ME!!! I will now pass the parameters", 64, "HEY!"

<% ' this is processed by server
   ' ONLY the response dictated by fieldstatus gets sent do client
 Select Case fieldstatus
  Case 1                
    Response.Write "window.IDfrm.IDradio2.disabled =true"
  Case 2
    Response.Write "window.IDfrm.IDradio2.disabled =true"
  Case 3
    Response.Write "window.IDfrm.IDradio2.disabled =true"
  Case Else
    ' whatever should happen if it's NOT 1,2,3!!
 end if
%>

End Sub

HTH



-----Original Message-----
From: Tsiris Alexandros [mailto:a.tsiris@;telesoft.gr] 
Sent: Tuesday, October 29, 2002 8:55 AM
To: ActiveServerPages
Subject: RE: passing variable to function



> Alexander, you'll get more help with this if you post the code that 
> illustrates what you're doing now.

Hi Chris, here it goes.

<% if rstSearchResults.Fields ("Status").Value = "ACTIVE" then
                        fieldstatus=1%>


the above is done right after I get a recordset from a databse. All is
ifne so far.

Then:

I call a function called LinkClick()

code here:

Sub LinkClick()

Dim strDis

msgbox "YOU CLIKED ME!!! I will now pass the parameters", 64, "HEY!"

if fieldstatus=1 then
        window.IDfrm.IDradio2.disabled =true
elseif fieldstatus=2 then
        window.IDfrm.IDradio2.disabled =true
elseif fieldstatus=3 then
        window.IDfrm.IDradio2.disabled =true

end if  

******************

the variable 'fieldstatus' is empty in the function.
Was wondering how I can make the variable 'seen' inside the function.

Thanks!
Alexander

---
You are currently subscribed to activeserverpages as:
[EMAIL PROTECTED] To unsubscribe send a blank email to
%%email.unsub%%



---
You are currently subscribed to activeserverpages as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]

Reply via email to