Hi
Thanks for the response. Unfortunately I still cannot get this to work. Been at this nearly 2 days now

Nothing I try will work. And I have tried a lot. This is where I am at the moment.
<div class="form-group">
@Html.LabelFor(model => model.confirmWord, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
<input type="button" class="easyui-linkbutton" id="confirmwordy" onclick="updateText(this.id)" style="width:20px;visibility:hidden" value="." />
@Html.EditorFor(model => model.confirmWord, new { htmlAttributes = new { @class = "easyui-passwordbox", style = "width: 300px;", id= "confirmWord" } })
@Html.ValidationMessageFor(model => model.confirmWord, "", new { @class = "text-danger" })
<img src="~/Images/Ribbon.png" onclick="generatePassword('confirmWord')" alt="confirmy" />
</div>
</div>
The source of which is
<div class="form-group">
<label class="control-label col-md-2" for="confirmWord">Confirm Password</label>
<div class="col-md-10">
<input type="button" class="easyui-linkbutton" id="confirmwordy" onclick="updateText(this.id)" style="width:20px;visibility:hidden" value="." />
<input class="easyui-passwordbox text-box single-line password" data-val="true" data-val-equalto="The password and confirmation do not match." data-val-equalto-other="*.word" id="confirmWord" name="confirmWord" style="width: 300px;" type="password" value="" />
<span class="field-validation-valid text-danger" data-valmsg-for="confirmWord" data-valmsg-replace="true"></span>
<img src="/Images/Ribbon.png" onclick="generatePassword('confirmWord')" alt="confirmy" />
</div>
</div>
and the Javascript I am using to update the password box is
function generatePassword(idx)
{
var newPass = Math.random().toString(36).substr(2, 9);
alert(newPass);
var t = $('#confirmWord');
alert('interim');
t.passwordbox('setValue', 'new value');
alert('here!');
}
I see the 'interim' alert box but nothing else. I've abandoned the parameter for the time being and hard coded the reference in to try and keep things simple. As is the none use of the hard coded 'new value' rather than newPass.
There looks to be something going wrong with
t.passwordbox('setValue', 'new value');
as I get the 'interim' but never the 'here!'.
Can someone see where I am going wrong. I thought this would be a 15 min job to sort (and it should be!) where as now I'm around the 15 hours mark :/
I cannot for the life of me see where I am going wrong. I've tried nearly everything I can think of.
When I saw the last response I thought the problem I was having was that I was still using the
@class = "easyui-textbox"
rather than the
@class="easyui-passwordbox"
neither will allow me to update the text. I have never seen the final alert message in the generatePassword function.
Any help here would be greatly appreciated!
I'm absolutely stumped.
Thanks
Steve.