Category: Computers > Programming
Asked by: fieldlily-ga
List Price: $10.00
27 Nov 2005 10:34 PST
Expires: 27 Dec 2005 10:34 PST
Question ID: 598159
Answered By: palitoy-ga on 28 Nov 2005 03:11 PST
Hello fieldlily-ga Thank-you for your question. The solution b_cummins-ga has provided us with a good basis to start on but unfortunately does not work in Firefox (or Mozilla based) browsers. As these now are used by approximately 10% of the people surfing the internet we should make the script compatible. Luckily this is simple to do. The problem with b_cummins-ga's script is the use of innerText which is only fully supported by Internet Explorer. To make it compatible simply change innerText to innerHTML. This makes the example below read: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>Change on submit</title> </head> <body> <p>First box:<br /> <input type="text" name="first"><input type="button" value="Submit" onClick="document.all.second.value = document.all.first.value; document.all.inpara.innerHTML = document.all.first.value"> </p> <p>Second box:<br /> <input type="text" name="second"> </p> <p>You typed:<br /><div id="inpara">nothing</div></p> </body> </html> Should you require any further assistance on this matter please do not hesitate to ask for clarification.
rated this answer:
and gave an additional tip of:
Worked like a charm. Thanks very much for an easy and effective solution.
From: b_cummins-ga on 27 Nov 2005 15:19 PST
try this. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title> New Document </title> </head> <body> First box:<br> <input type="text" name="firstBox"><input type="button" value="go" onClick="document.all.secondBox.value = document.all.firstBox.value; document.all.theBody.innerText = document.all.firstBox.value"> <br><br><br> Second box, further down the page:<br> <input type="text" name="secondBox"> <br><br><br> and in the body the word is <b><div id="theBody">not set</div></b> </body> </html>
From: palitoy-ga on 28 Nov 2005 10:55 PST
Thank-you for the 5-star rating and generous tip! They are both appreciated.
If you feel that you have found inappropriate content, please let us know by emailing us at firstname.lastname@example.org with the question ID listed above. Thank you.
|Search Google Answers for|