you might need to be a little more specific... can you give an example of what you mean, a url to an example, or a more descriptive elaboration?
__________________
Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)
there is a button in the page
<p><input type="submit" name="button" value="button"></p>
how do i click the button using JAVESCRIPT and not by the mouse when the page is loaded?
so you want this button to be activated when the page is loaded?
i know its possible... i dont offhand know how. it would use either
Code:
window.onload="something"
or
<body onload="something">
maybe something like
Code:
function clickOnLoad()
{
document.formname.button_name.value = "true";
}
....
<body onload="clickOnLoad()">
formname is the name of your form
button_name is the name of the button
I dont know about the .value = true; part... someone will have to check that for me
__________________
Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)
You want a form to submit all by itself when the page containing the form is loaded? The following should work as long as you've only got one form on the page.
Code:
<body onload="document.forms[0].submit();">
__________________
Check out the Forum Search. It's the short path to getting great results from this forum.
__________________
Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)
errmm... Hemebond, what exactly does that do to help this issue at hand...? from what i get that disables the button once its clicked...
__________________
Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)
The button is disabled because it has been clicked. I've just shown how to click a button using Javascript.
If he just want's to submit a form when the page loads, that's extremely simple; but for anyone looking for a way to click a button using Javascript, there's the solution.
isn't there an obj.click() ? which simulates clicking a button? although it's not speficied in any standard, I am pretty I've seen it in the JS reference for IE and Mozilla/Firefox.
Button.click() is not only not a part of any standard (as msdn would say), it's poorly supported.
Roy S. answered this properly. A button is a UI widget - it allows a user to launch script, or whatever. You're not a user (well, not in this case, anyway). Program it!
__________________
Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)