There are several ways you can do this ranging from quick and dirty to elegant.
The two easiest ways are as follows:
1. Change the style attribute for each of the div objects to be hidden by default. This is probably preferred to the second option because you don't need to utilize JavaScript...
It may be helpful for you to put a line of debugging code in there. Also, you shouldn't give a name or ID to any HTML element using a reserved keyword (e.g., "select").
Rename your select element to something like "selOption" and add an alert() within your change function to be sure the value...
Hi.
Take a look at your JavaScript function:
function show_hide (obj) {
var el = document.getElementById(obj);
if ( el.style.display = 'block' ) {
el.style.display = 'none';
} else {
el.style.display = 'none';
}
}
A couple of things to note:To test for...
Define "required". If you have some code for requiring certain fields, you will need to share that with us. If you only want to change the value of the text box, that can easily be done with an onclick event.
----
It is very hard to tell from this code, and you haven't provided a working example, but I'd suggest calling the form's submit event immediately after you call the code that populates the text box.
----
I'd avoid the all collection at all costs. You could use the click() function of the button after referring to it properly, or you could simply call the submit() function of the form itself.
----
There is no way to explicitly be sure that your user successfully printed the page using JavaScript. You could potentially write some ActiveX to do this, but it's not worth the effort.
window.close() will close the browser window. Note that the user will be prompted with a "the browser is...
You might also consider applying styles to a:active, a:hover, a:link, a:visited to avoid JavaScript altogether.
http://www.w3schools.com/CSS/css_pseudo_classes.asp
----
I respectfully disagree with vacunita. You don't need to use divs for anything necessarily, unless specific need arises. The same example provided above could just as easily be done as below. This would also be more semantically correct.
<img id="logo" src="../logo.gif" alt="My Logo" ... />...
You should develop your content with appropriate HTML elements first, in a logical order (logo, then menu, then title, then content, for example), and then apply style to it all when the content is complete. Your page should look readable if you remove the CSS completely (albeit plain).
Take a...
You should be able to achieve this using a global javascript variable. You can set the variable initially when the user clicks the load button (using the onclick event of the button), and then compare it to the current time using the onload event of the iframe.
----
It would be very helpful in the future if you post your client-side script (the HTML produced within the browser) instead of your server-side code.
That being said, try this:
echo '<select name="Barcode" size="15" style="width:150px;" onchange="this.form.submit();">';
----
images are input fields. when you use them AS form elements, I believe they only submit the mouse location or some useless garbage like that.
if you're looking for sexy input and cancel buttons, the best method is to use submit and reset buttons and style them appropriately. this way, you...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.