2 Replies - 3317 Views - Last Post: 14 November 2009 - 05:50 PM

#1 fsloke   User is offline

  • D.I.C Regular

Reputation: 26
  • View blog
  • Posts: 413
  • Joined: 19-December 07

How to set value to the cloned object?

Posted 07 November 2009 - 09:08 PM

I am beginner in JQuery.

I doing the form in such

Posted Image

1. When user enter Text to the textBox
2. Click on Add button
3. The text will displayed.

Below is my part of my source code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Platform</title>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){

	$("#display-platform").hide();
	
	$("#insert-platform").click(function() {
		var form = $("form#platform-search");
	
		var addDisplayPlatform = $("#display-platform").clone();
		$("#first-platform").after(addDisplayPlatform.show());
		
		$("#add-route-point").clone()	
		if($("#delete-platform").attr("disabled"))
			$("#delete-platform").attr("disabled", false);
		
		return false; 
	});
});
</script>  
</head>
<body>
<table>
	<tr>
		<td>
			<div class="item" id="platform-list">					
				<div style="margin-bottom:15px;">	
					<div class="title"><b>Platform</b></div>
					<div style="float:right;">
						<input type="text" name="plateformCode" size="26"/>
						<input type="button" value="ADD" id="insert-platform">
						<input type="button" value="DELETE" id="delete-platform">
					</div>							
				</div>
				
				<form id="platform-search">
				<table>
					<thead  id="first-platform">
						<tr>
							<th>No</th>
							<th>Platform</th>
							<th><input type="checkbox" name="selector" value="All" /></th>
						</tr>
					</thead>
					<tbody id="display-platform">
						<tr>
							<th id="counter">Counter</th>
							<th id="platformText">Platform</th>
							<th><input type="checkbox" name="selector"/></th>
						</tr>
					</tbody>
				</table>
			</div>
		</td>
	</tr>
</table>
</body>



I not sure how to set the value to the cloned object?

If you found my way I do the thing is wrong, please recommend me how can I make the that done?

I in still in try and error to learn JQuery...

Thanks

Is This A Good Question/Topic? 0
  • +

Replies To: How to set value to the cloned object?

#2 Wimpy   User is offline

  • R.I.P. ( Really Intelligent Person, right? )
  • member icon

Reputation: 159
  • View blog
  • Posts: 1,038
  • Joined: 02-May 09

Re: How to set value to the cloned object?

Posted 08 November 2009 - 06:45 AM

I don't really understand what it is you want to do(?), do you want to set a new value/text to a cloned object? If that is the case, which one of the cloned objects do you want to set a value to, you clone two different objects in the code you provided ( even though you only seem to use one of them ). More details please! :)

This post has been edited by Wimpy: 08 November 2009 - 06:45 AM

Was This Post Helpful? 0
  • +
  • -

#3 fsloke   User is offline

  • D.I.C Regular

Reputation: 26
  • View blog
  • Posts: 413
  • Joined: 19-December 07

Re: How to set value to the cloned object?

Posted 14 November 2009 - 05:50 PM

From the diagram and the JQuery script you already able to figure out what I try to cloning.

I plan to clone display-platform once the Button Add pressed.

Thanks
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1