|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
Hi all,
I am looking to set value on the onClick event of the dropdown box. The problem is that my function which I need the variable for, calls a DLL and has been implemented on the Server side Javascript (within the <% %>) The page is an ASP page and our default script for most part of the website is JavaScript. I need help with this please. Here is the code.. <select name="state" size="1" onChange="displaydesc(document.selectstate.state.selectedInd ex); tempo=document.selectstate.state.selectedIndex;"> <option value="SS" selected>Select State</option> <option value="CA" >California</option> <option value="FL" >Florida</option> <option value="IL" >Illinois</option> <option value="NV" >Nevada</option> <option value="TX" >Texas</option> </select> <% var bStatus, state ; var oMan = Server.CreateObject("the dll"); bStatus = oMan.RequestGetCoverageStateList(); if (oMan){ state = "CA"; (I want this value to be dynamic, depending on the selected state on the drop down box. Want it to go dynamic with tempo !) bStatus = oMan.RequestGetCoverageRateCenterList(state); } var oItem=null; var oStates = new Enumerator(oMan.CollectionData); while (!oStates.atEnd()) { oItem = oStates.item(); Response.Write ("<option value=" + "<BR>" + oItem.NPA + ", " + oItem.Carrier + ", " + oItem.Exchange + "</option>"); delete oItem; oItem = null; oStates.moveNext(); } oMan=null; delete oMan; %> |
|
#2
|
||||
|
||||
|
You have to submit a form in order for ASP or SS JS to obtain the value of the form item. So, to obtain the "state" variable, you would need to first submit the form, then request the value of the "state" dropdown object (e.g. request.form("state")). I think you are getting your server-side and client-side stuff confused. SS JS does not have access to the user event handlers such as onClick, onChange, etc. They are client side only.
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > setting value to server side JScript from onClick event |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|