Jump to content

JavaScript Drop down value Null when click Submit Button in CHROME


Raj_100
 Share

Recommended Posts

Hi can any one help on this below issue: in javascript dropw down list sending a null value.i have 2 textfiled and one drop down list. when i enter username and passaword and drop down is good.but issue is when i submit the dropdown value is null for chrome and issue is working fine in IE.for this i can able to see in log file. i hope issue with "document.getElementById("stdid ").value=stdrole" Can anyone tell me solution for this. Thanks in a Advance Regards Raj Kumar R

Link to comment
Share on other sites

function validateLoginForm(){
var username = document.getElementById("firstname").value;
var password = document.getElementById("password").value;
var rolesList = document.getElementById("stdid");
var roleValue = rolesList.options[rolesList.selectedIndex].value;
if((username == null ||username =='') || (password == null||password=='') || stdid =='EMPTY_ROLE'){
document.getElementById("password").value = "";
document.getElementById('nullValidation').innerHTML = '<font color="#FF0000" size="1">Please enter a valid User ID, Stdid& Password before login.</font>';
return false;
}else{
document.getElementById("stdid").value = roleValue;
alert(document.getElementById("stdid").value);
return true;
}
}
If i set alert(document.getElementById("stdid").value); msg . Alertbox populated but when i check in chrome alertbox ix not coming and Stdid value is setting null.
Please suggestion on this issue
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...