Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need some help with a webpage

Status
Not open for further replies.

lilygunmetal

Technical User
Mar 7, 2011
1
US
Hi all. I came here because I need some help. I’m a ceramicist and have this idea for a project. I have a bit of an idea of what I need to do but am not sure how to get it to work.
So I’m putting barcodes on all my pieces and I want the webpage I’m building to pull up another page when the barcode is scanned.
I’ve been told that I need a page with a form and an iframe. I have that done, but I need some more help. The form has one input box for the barcode. I need .html added to the end of whatever is in the input box to pull up a specific page for the barcode and pulling that up into the iframe on submit. And if possible on load to clear the form box and set the form box back to focus, so that it is ready to scan another barcode. I want it to do this so that when the piece is installed the laptop can be hidden from view.
I would appreciate some help to walk me through the code to do this.
Thanks so much in advance
 
1 . Call a function on the onClick event of the submit button.

Code:
<input type="submit" ... onClick="load_Page(); return false;">

2. Then in your function add the necessary code:

Code:
<script type="text/javascript">
function load_Page(){
var barCode=document.getElementById('textboxID');
var url=barCode + ".html";
var theIframe=document.getElementById('iframeID');
theIframe.src=url;
barCode.value="";
barCode.focus();
}
</script>

[ol A]
[li]Get textbox object using its ID.[/li]
[li]set url variable to textbox contents (the barcode) and add the html suffix.[/li]
[li]get the iframe object using its ID[/li]
[li]Set iframes src to the constructed URL. (this will cause the iframe to load the page) [/li]
[li]clear value of textbox[/li]
[li]set textbox focus.[/li]
[/ol]

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Behind the Web, Tips and Tricks for Web Development.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top