Solved

Object References

Posted on 2004-10-08
2
161 Views
Last Modified: 2010-04-25
Is there any way to find out a specific reference to an object in DreamWeaver?  I come from an extensive FoxPro back ground and in Fox, you can right click on your program and tell it to insert a reference from an object on your screen.  Here's an example:

<form name="fred">
bla
bla
bla
<span>
<input type="radiobutton" name="rbtn" value="a">
<input type="radiobutton" name="rbtn" value="b">
<input type="radiobutton" name="rbtn" value="c">
</span>
</form>

Now, I want to know the specific reference to the second radio button on this form.  Any way to do it or can someone take me to the place I can find out.  What I want to do is reference it like this:

<input type="button" name="whatever" onclick="javascript:document.fred.radiobutton[2].click()">

Thanks in advance.
0
Comment
Question by:bryanhurl
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 5

Accepted Solution

by:
smaglio81 earned 500 total points
ID: 12265239
I am not exactly sure what your end goal is. But, that won't stop me from guessing.

Make a blank "debugging" page (a blank html page), and add this code to it:

<script language="javascript">
      function whichIsSelected() {
            if( document.fred.rbtn[0].checked ) document.fred.output.value = document.fred.rbtn[0].value;
            if( document.fred.rbtn[1].checked ) document.fred.output.value = document.fred.rbtn[1].value;
            if( document.fred.rbtn[2].checked ) document.fred.output.value = document.fred.rbtn[2].value;
      }
</script>

<form name="fred">

<input type="radio" name="rbtn" value="a" checked />A<br />
<input type="radio" name="rbtn" value="b" onClick="document.fred.rbtn[2].checked = true" />B<br />
<input type="radio" name="rbtn" value="c" />C<br />

<br />

<input type="text" name="output" value="" />

<br /><br />

<input type="button" value="Click Me" onClick="document.fred.output.value = document.fred.rbtn[2].value" />
<input type="button" value="Hit Me" onClick="document.fred.rbtn[1].checked = true" />
<input type="button" value="Whack Me" onClick="document.fred.output.value = document.fred.rbtn.value" />
<input type="button" value="Check it" onClick="whichIsSelected()" />
<input type="button" value="Call it" onClick="document.fred.rbtn[1].click()" />

</form>

Just mess around with this code for a while, and I think you will see how the stuff interacts with one another.

I would give you a more clear & concise answer, but I really don't know that much about Javascript. Your question actually made me want to find out more of its usages; that is why this example code has so many different functionalities. One of the most interesting things, with the above code, is when you press the 'Whack Me' button. The value that is returned to the output text box is 'undefined'; which must have some pretty interesting implications that I do not yet understand.

HTH

Steven
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For those who don't know, Adobe Dreamweaver is a popular commercial web editor that enables you to design, build and manage complex websites. The editor is a WYSIWYG (What You See Is What You Get) web editor, which means that you can create your web…
This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question