Solved

Object References

Posted on 2004-10-08
2
147 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
2 Comments
 
LVL 5

Accepted Solution

by:
smaglio81 earned 500 total points
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

771 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now