client side javascript with server side onclick

Results 1 to 2 of 2

Thread: client side javascript with server side onclick

  1. #1
    Join Date
    Dec 1969

    Default client side javascript with server side onclick

    I have a few imagebuttons inside a repeater which i am tring to add a javascript onclick event to. I want it to process the javascript and if the function returns true then go to the server side click event.I tried to add the onclick event on the code behind page as follows:<BR><BR>For Each outerRI In rptCarts.Items<BR> Dim btnU As ImageButton = outerRI.FindControl("btnUpdate")<BR> Dim btnQ As ImageButton = outerRI.FindControl("btnQuote")<BR> Dim btnP As ImageButton = outerRI.FindControl("btnProcess")<BR><BR> btnP.Attributes.Add("onclick", "return placeorder();")<BR> btnQ.Attributes.Add("onclick", "return placeorder();")<BR> btnU.Attributes.Add("onclick", "return placeorder();")<BR>Next<BR><BR>But it seems to ingore the javascript and only does the code behind click event. Is there a way to add the javascript inside the repeater on the aspx page, and have it do the javacript funciont and depending on the ruturn value then go on to process the click event???? Any information may be helpful! Thanks in advance<BR><BR>Ryan

  2. #2
    Join Date
    Dec 1969

    Default are you sure

    that your javascript function "placeorder()" is returning false?<BR><BR>i can tell you for sure that what you are doing is possible (even looks like the proper code as long as the function is working as it should)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts