Note that there are some explanatory texts on larger screens.

plurals
  1. POJavaScript question
    text
    copied!<p>calling a js function using onclick...</p> <pre><code>onclick="SubmitAge(66, 'ctl00_MainContent_arTo_upAgeRange')" </code></pre> <p>function just calls an updatePanel from the client... but its saying object expected at the onclick= part!!!</p> <p>here is the function, is there anything wrong with the code?</p> <pre><code>function SubmitAge(age, UpdatePanelID) { $get('HiddenAge').value = age; __doPostBack(UpdatePanelID); } </code></pre> <p>EDIT: THE SUBMITAGE FUNCTION IS INSIDE A .JS FILE (AGERANGE.JS) AND ONLY WHEN MOVED HERE DOES IT STOP WORKING: HERE IS THE LINKING METHOD/HEADERS FROM THE ASCX USERCONTROL INWHICH IT IS ALL CONTAINED...</p> <p>%@ Control Language="VB" ClassName="AgeRange" %</p> <p>%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="AjaxCT" %</p> <p>script src="AgeRange.js" type="text/javascript" /script</p> <p>(arrow tags removed here as it wont display, hint: stackoverflow!!!)</p> <p>im printing it like this from the server...</p> <pre><code>Public Sub AppendToSB(ByRef sb As StringBuilder, ByVal CurNo As Byte, Optional ByVal clickedNo As Byte = 0) Dim sConfirmClick = "" If clickedNo = CurNo Then ' maybe dont make it clickable... sConfirmClick = "return confirm('The number " &amp; CurNo.ToString &amp; " is already selected, are you sure you want to select it again?');" End If sb.Append("&lt;a href=""#"" onclick=""" &amp; sConfirmClick &amp; "SubmitAge(" &amp; CurNo.ToString &amp; ", '" &amp; upAgeRange.ClientID &amp; "')"" runat=""server""&gt;" &amp; CurNo.ToString &amp; "&lt;/a&gt;") End Sub </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload