JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 24th, 2001, 12:49 PM
jtchang jtchang is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Posts: 14 jtchang User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 18 m 26 sec
Reputation Power: 0
need help with javascript

Can someone help me find an alternative to the "onClick" function.
I am trying to alter another user code. In the code below, I am trying to set the variable "nFlocBy = ByAddress" when the user does an onClick event. Can someone help me find an alternate way of coding where I want to set "nFlocBy = ByAddress" without having the user do the onclick event.

In the code below, if address2 is not null then set the radio button to be checked and when the user click on the radio button, set nFlocBy = ByAddress. How can I skip the onclick event and make it where nFlocBy = ByAddress without having to go through the onclick event.

If you think about it, why would the user have to click on the radio button if its already check. for some reason, my program will not work unless the button is clicked. please help

thanks ahead

<%

if ((!Address2==null) || (!Address2=="")){
strFLocBy = "2";
ByAddress = "2";
}
%>
<input type="radio" name="FLocBy" value="2"<%= Check( strFLocBy, ByAddress) %> onClick="nFLocBy=ByAddress">

Reply With Quote
  #2  
Old September 24th, 2001, 03:03 PM
bramsey bramsey is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2000
Location: USA
Posts: 226 bramsey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 40 m 35 sec
Reputation Power: 13
I don't know if this would work for your situation, but you can always but the function in an onLoad command within the body tag. That way, the variable will be set as the page loads.

Reply With Quote
  #3  
Old September 28th, 2001, 02:53 PM
anciano anciano is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 1999
Posts: 2 anciano User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to anciano Send a message via AIM to anciano Send a message via Yahoo to anciano
Lightbulb An idea I haven't tested

what you can do is to send the event message to the radio button. I don't know if it's possible, but it should be. and my idea would flow something like this:

function yourFunctionThatTestsSomeValue() {
if(theObjectThatYouAreInterestedIn.hasSomeValue()) {
/*the value that you tested was found*/
radioObjectThatYouWantToChange.click();
/*cause the radioobject to do whatever its onclick handler says to do*/
}

Check out devguu.com where I see that the radiobutton object does have this type of method.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > need help with javascript

Developer Shed Advertisers and Affiliates



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 | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap