Jump to content
Sign in to follow this  
Raj_100

JavaScript Drop down value Null when click Submit Button in CHROME

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Thanks srini now issue is got fixed and let me tell you another issue

 

var t1 = document.getElementById(id); this t1 value giving null

 

can you please explain to me what are the way we can getelement in js

 

Thanks in a Advance

 

Regards

Raj Kumar R

Share this post


Link to post
Share on other sites

var t1 = document.getElementById(id); this t1 value giving null

That means that an element does not exist with that ID.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...