Jump to content

update fields


doddsey_65

Recommended Posts

i have some javascript which should show the messages at the side of the input but they arent and i dont know where im going wrong.

 

<script language="javascript">
$(document).ready(function()
{
$("#fullname").blur(function()
{
//remove all the class add the messagebox classes and start fading
$("#msgbox1").removeClass().addClass('messagebox').text('Checking...').fadeIn("slow");
$.post("update.php",{ fullname:$(this).val() } ,function(data)
{
if (data==1)
{
$("#msgbox1").fadeTo(200,0.1,function() //start fading the messagebox
{
//add message and change the class of the box and start fading
$(this).html('Update Successful').addClass('messageboxerror').fadeTo(900,1);
});
}
else
{
$("#msgbox1").fadeTo(200,0.1,function() //start fading the messagebox
{
//add message and change the class of the box and start fading
$(this).html('Error Updating').addClass('messageboxerror').fadeTo(900,1);
});
}
});
});
});
</script>

 

<input class="input2" id="fullname" type="text" name="fullname" value="<?php echo $tab_info->user_real_name; ?>" />
<span id="msgbox1" style="display:none"></span>

 

ive used this before and it worked but not this time. ANyone know why?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.