Problem to update value

Hi,
Within Javascript below, I cannot update value into tb_pass. Why?
                    var name = this.$content.find('.name').val();
                    var newname = this.$content.find('.newname').val();
                    var status = this.$content.find('.status');
                    if (name == "") {
                        $.alert("Invalid password and please enter one valid password!");
                        return false;
                    }
                    if (name == newname) {
                        // status.val(scorePassword(name));
                        //$.alert('Valid Password is entered!');
                        var pass_val = document.getElementById("tb_pass").value;
                        pass_val = name;
						...
                <asp:Textbox ID="tb_pass"
                    width="310px"
                    Style='display:none;visibility:hidden;'
                    Font-Names="標楷體" 
                    Font-Size="11pt" 
                    Font-Bold="true"
                    ForeColor="Black"
                    runat="server" />
					...

Open in new window

LVL 11
HuaMin ChenSystem AnalystAsked:
Who is Participating?
 
Ryan ChongCommented:
anyway, your text field is not visible:

<asp:Textbox ID="tb_pass"
                    width="310px"
                    Style='display:none;visibility:hidden;'
                    Font-Names="標楷體"
                    Font-Size="11pt"
                    Font-Bold="true"
                    ForeColor="Black"
                    runat="server" />

you may consider to remove that line of code temporarily for debugging.
0
 
Ryan ChongCommented:
do you mean something like this?

document.getElementById("tb_pass").value = "somevalue";

Open in new window

0
 
HuaMin ChenSystem AnalystAuthor Commented:
After the execution of above Javascript codes, I further see no value to tb_pass. Why?
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

 
Ryan ChongCommented:
I further see no value to tb_pass. Why?
as only partial script is posted here, we can't really debug for you.

it would probably some JavaScript error occurred which prevent your scripts to be executed successfully.

try open the browser's Inspect feature, and go to relevant Console or Debug panel and see if there's any errors detected there?
0
 
HuaMin ChenSystem AnalystAuthor Commented:
To

http://my-friend.co/UserMaintenance2/Default.aspx?userid=mc4&readonly=n

you can choose 1st button (for password), by inputting one password for testing, to see tb_pass.Text does not capture the value well.
0
 
Ryan ChongCommented:
getting an error at:

$(this).parent().next().modal("show");

Open in new window


in JavaScript1.js:198:17

what is purpose of this line for?
you may try to remark it and try again?
0
 
HuaMin ChenSystem AnalystAuthor Commented:
I removed the line. But tb_pass still cannot capture the value (of input to the prompt password), after re-deployment.
0
 
Ryan ChongCommented:
instead of :
var pass_val = document.getElementById("tb_pass").value;
                        pass_val = name;

Open in new window


you should try:

document.getElementById("tb_pass").value = name;

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.