Previous in Forum: Construction Management System   Next in Forum: My Computer Can Not Read Excel File
Close
Close
Close
Rate Comments: Nested
Member

Join Date: Feb 2008
Location: Port Harcourt, Nigeria
Posts: 7

Javascript or HTML Code for Action Page to Append Text from Input Form to URL

11/20/2012 6:47 AM

Java script or HTML code for action page to append text from input form to URL of another frame?

I am learning web design online and doing what I wanted to do, but I need some one to help me out here.
As part of my language development website, we are writing a page that will render the local language translation of numbering value from 1 to 99999999 in a frame set. the translation of numeral value in my local language have to do with lots of addition, minus, multiplication and division to define a name for most values above 200 to 99999999, this made the writing of code (Java script, PHP) a very complext task we 've not being able to achieve.

I succeeded in writing a .htm file for each of the numbering containing the value in english word and the translation in my local language from 1 to 99999999. to be viewed in a frameset (top frame and buttom frame).

I need a java script or html code for input box so that the top frame will contain text input with buttom frame as my target for the link to the figure typed into the input.
e.g.
www.mysite.com/translation/34 (this is my link to the figure 34) what i needed now is code for input box in top frame to append the figure enterred into the input field to the url of the buttom frame with a link to input content.
i.e.
www.mysite.com/translation/ + text from input box; target="buttom frame"

Register to Reply
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.
Member

Join Date: Sep 2012
Posts: 8
Good Answers: 1
#1

Re: Javascript or HTML Code for Action Page to Append Text from Input Form to URL

11/21/2012 4:23 AM

Hello Friends,

If you're combining javascript and PHP why not look at AJAX to do all the work? and instead of using frames you can simply use DIVs and let javascript change the innerHTML as needed.

Save this code as a HTML and see how it works
-------------
<!doctype html><html><head><meta charset="utf-8">
<script type="text/javascript">
<!--
function changeText(id, txt, clss) {
if (clss) { // change all classes matching ID
divs = document.getElementsByClassName(id);
for (i=0; i<divs.length; i++) {
divs[i].innerHTML = txt;
}
} else {
document.getElementById(id).innerHTML = txt;
}

}
-->
</script>
<style type="text/css">
div {
border:1px dashed #000;
margin:2px;
float:left;
clear:both;
width:300px;
}
</style>
<title>innerHTML</title>
</head>
<body>
<div id="changeme"><a href="javascript:changeText('changeme', 'That wasn\'t difficult..')">Click here to change the text</a></div><br>
<br><br><br><br>
<div class="humans"><a href="javascript:changeText('humans', 'We are borg!!', true)">Click here to attack the borg.</a></div>
<div class="humans">Humans rule!</div>
<div class="humans">Humans rule!</div>
<div class="humans">Humans rule!</div>
<div class="humans">Humans rule!</div>
<div class="humans">Humans rule!</div>
<div class="humans">Humans rule!</div>
</body>
</html>
<!-- spaceId: 2114717203 -->
<!-- Teoma -->

Best Regards,
Steven Arnold

Hp Proliant Dl 380

Register to Reply
Register to Reply

Previous in Forum: Construction Management System   Next in Forum: My Computer Can Not Read Excel File

Advertisement