JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
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  
Old April 8th, 2004, 08:31 PM
ankush_del ankush_del is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 1 ankush_del User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy setting value to server side JScript from onClick event

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;

%>

Reply With Quote
  #2  
Old April 9th, 2004, 12:56 AM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 6 m 11 sec
Reputation Power: 8
Send a message via ICQ to stumpy Send a message via MSN to stumpy
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.
__________________
DevArticles Moderator
BlueSix - Web Development and Consulting

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > setting value to server side JScript from onClick event


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway