Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

call function from onlick 1

Status
Not open for further replies.

moleboy

IS-IT--Management
Oct 10, 2002
33
GB
Anyone,
I'm trying to call a function when a buttons clicked. Heres the code

<%
function Accesslevel() 'function to stop access to level1 users
If HasAccess = 0 Then
alert(&quot; You do not have access to this part of the system.&quot;)
return false
else
return true
end if
end function
%>

<a href=&quot;admin_edit.asp?login=<%=loginID%>&quot; onclick=&quot;accesslevel()&quot;><img src=&quot;images/go_button.gif&quot; width=&quot;27&quot; height=&quot;23&quot; border=&quot;0&quot;></a>

on clicking the button i get a type mismatch &quot;accesslevel&quot;

any ideas??
 
YOU cannot call a server-side function from a client-side event (onClick) unless you call the server again - what is it that you're trying to do?

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook
 
try reading through this faq333-3048 and the rest of the General FAQ area

____________________________________________________
The most important part of your thread is the subject line.
Make it clear and about the topic so we can find it later for reference. Please!! faq333-3811

onpnt2.gif
 
Thanks, its fixed now using vbscript language clientside

cheers

moley
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top