Reputation: 45
I have a Javascript function that triggers on a button's "onclick" event.
<input type="button" value="Verify" id="b1" onclick=myFunction() />
I need to disable this button on another button's onSubmit()
method in Wicket. For that I figure I'll use setEnabled(false)
. But if I bind the button with Wicket, its onclick
event in HTML does not trigger.
HTML:
<input type="button" wicket:id="verify" value="Verify" id="b1" onclick=myFunction() />
Java:
public class MyPanel extends Panel {
public MyPanel(...){
// other components
Button verify = (Button) new Button("verify");
verifyThumb.setEnabled(true);
// other components
}
}
I need to call the Javascript function as well as disable the button.
Upvotes: 0
Views: 497
Reputation: 928
Please verify your input tag. You have missed "" for onclick event.
<input type="button" wicket:id="verify" value="Verify" id="b1" onclick="myFunction()" />
Upvotes: 1
Reputation: 349
Simple:
<input type="button" wicket:id="verify" value="Verify" id="b1" onclick="myFunction()" />
You have to put quotes around the onclick function
Upvotes: 1