jQuery(document).ready(function(){
$("#button").submit(function() {
{
var email_id=document.getElementById('textfield').value;
var password=document.getElementById('textfield2').value;
var utype=document.getElementById("utype").value;
var url="login_check.jsp?&email_id="+encodeURIComponent(email_id)+"&password="+encodeURIComponent(password)+"&utype="+encodeURIComponent(utype);
$('form').get(0).setAttribute('action',url);
alert(document.form1.action);
}
});
on the click of submit button with id=”button” an alert dialog box should appear with the url….. Why the above code is not working? Please help
Replace with:
Also see this example.
=== UPDATE 2 ===
Here a short version:
HTML:
JS (is not neccessary if you don’t want to do more):
And an example.