Solved

Can I insert an HTML form into this javascript plug-in?

Posted on 2012-04-10
1
159 Views
Last Modified: 2012-06-27
I am using the javascript navigation tree shown below:

http://www.audioproductivity.com/dTree/example02.html

I want the radio buttons to appear next to the correct item in the navigation tree, but the radio button always appear at the top of the navigation tree.  I attached a code snippet, I thought this would solve the problem... but no luck.

<div class="dtree">

	<p><a href="javascript: d.openAll();">open all</a> | <a href="javascript: d.closeAll();">close all</a></p>

	<form name="aa">

	<script type="text/javascript">
		<!--

		d = new dTree('d');

		d.add(0,-1,'Sports');
		d.add(1,0,'Basketball');
		d.add(2,1,'Lakers');
		d.add(3,2,'Suite');
		</script><input name="input1" type="radio" id="Lakers-Suite" value="Lakers-Suite" /><script type="text/javascript">
		d.add(4,2,'Courtside');
		</script><input name="input2" type="radio" id="Lakers-Courtside" value="Lakers-Courtside" /><script type="text/javascript">
		d.add(5,1,'Bulls');
		d.add(6,5,'Front Door');
		</script><input name="input3" type="radio" id="Bulls-FrontDoor" value="Bulls-FrontDoor" /><script type="text/javascript">
		d.add(7,1,'Pacers');
		d.add(8,7,'Courtside');
		</script><input name="input4" type="radio" id="Pacers-Courtside" value="Pacers-Courtside" /><script type="text/javascript">
		d.add(9,0,'Hockey');
		d.add(10,9,'Red Wings');
		d.add(11,10,'Mezzanine Level');
		d.add(12,9,'Sharks');
		d.add(13,12,'Section 71');

		document.write(d);

		//-->
	</script>
	</form>
</div>

Open in new window

0
Comment
Question by:tprofits
[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
1 Comment
 
LVL 6

Accepted Solution

by:
bartvd earned 500 total points
ID: 37829539
The navigation tree is printed when you call document.write(d); This is why your solution doesn't work. You would have to adapt the print function of the plugin.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PHP: Filling Out/Creating a PDF 29 163
PHP Web Development 6 66
replacing inline javascript with jquery 4 63
Where is this content coming from? 4 38
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

739 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