Click here to Skip to main content
15,895,084 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
//////textbox and button
Currency Name:<input id="Text1" type="text" />

 FC:                 <input id="Text2" type="text" />


Rate:               <input id="Text3" type="text" />

 LC                :<input id="Text4" type="text" />


<input id="Button1" type="button" value="Submitt"onclick=" return transaction();" />  
//////////////////////////////////////
java script code
function transaction() {
var XML = document.createElement("div");
var Node = document.createElement("transaction");
// $(newNode).appendTo($xml.find("currency_name"));
Node.appendChild(document.createElement("currency_Name"));
Node.appendChild(document.createElement("Fc"));
Node.appendChild(document.createElement("Rate"));
Node.appendChild(document.createElement("Lc"));
XML.appendChild(Node);


alert(XML.innerHTML);

}
Posted
Comments
Sergey Alexandrovich Kryukov 19-Jan-15 2:48am    
Why? How this question is related to your code fragment? What's the problem? Create from what?
You "XML" object is not XML. This is DOM.
—SA
Member 11384714 19-Jan-15 6:30am    
bascially sir i want to add textbox value into gridview without using database in using a jquery.for that perpose i want to create xml to save the textbox value then make a string and this string save in a hiddenfield

Please see my comment to the question. The question is not correctly formulated and not clear. In your code fragment, you are not trying to use jQuery, but you can. You can find everything here: http://api.jquery.com/category/manipulation[^].

—SA
 
Share this answer
 
Comments
Member 11384714 19-Jan-15 6:12am    
bascially sir i want to add textbox value into gridview without using database in using a jquery.for that perpose i want to create xml to save the textbox value then make a string and this string save in a hiddenfield
Sergey Alexandrovich Kryukov 19-Jan-15 14:01pm    
The referenced article tells you everything. The text box value is just another DOM element, represented by the property value. In jQuery, this is .val():
.val().
—SA
I am guessing that you like to create XML using jQuery. If this is the case please see Generate XML document in-memory with JavaScript[^]
 
Share this answer
 
Comments
Member 11384714 19-Jan-15 6:37am    
thank you .. i asked some suggestion from you that how we save text box value in that xml document please help me ??

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900