CodeIgniter Forums

Full Version: How to script into my click to save button in javascript
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]nOsCiRe[/eluser]
// My JavaScript using jquery
$(function()
{
$( "#dialog-form" ).dialog(
{
autoOpen: false,
resizable: false,
height: 270,
width: 350,
modal: true,
buttons:
{
"Click to Save": function()
{
// please help me on how to script on this area with validation of change password and save to database
$( this ).dialog( "close" );
},

Cancel: function()
{
$( this ).dialog( "close" );
}
},
close: function()
{
allFields.val( "" ).removeClass( "ui-state-error" );
}
});

$( "#changepassword" )
.button()
.click(function()
{
$( "#dialog-form" ).dialog( "open" );
});

});

My View Script

<div id='dialog-form' title='Change Password'>
<p>class='validateTips'>All form fields are required.</p>
<fieldset>
<label for='NewPassword'>New Password</label>
&lt;input type='password' name = 'npassword1' id = 'npassword' value='' class='text ui-widget-content ui-corner-all' /&gt;
<label for='Confirmpassword'>Confirm Password</label>
&lt;input type='password' name = 'cpassword'id='cpassword' value='' class='text ui-widget-content ui-corner-all' /&gt;
</fieldset>
&lt;input class = 'changepassword' type = 'button' id ='changepassword' value = 'Reset Password'/&gt;