Jump to content

Div refresh - Not automatic!


TeddyKiller

Recommended Posts

If I have a JQuery like.. form validation, which uses an external php page to do all the validation etc if you know what I mean, upon the success: - How can I refresh a div.

 

The div must have its contents loaded upon page load. It must also be reloaded upon the success section in an JQuery Ajax Form Validation.

 

If you'd like to post me a code about for the validation, just let me know. Although I think I made myself clear enough to what I want to do.

Link to comment
Share on other sites

<head>
<script type="text/javascript">
function refreshDiv()
{
document.getElementById("refresher").innerHTML="changed content";
}
</script>
</head>
<body>
<div id="refresher">Content</div>
<a href="javascript:refreshDiv()">change the contents</a>
</body>

Link to comment
Share on other sites

It's not like that though.

It's a form, with a button. When the button gets pressed, the ajax does it work. Now.. the form displays some information from the database. I'd like that to be refreshed. It's got nothing to do with the external php page for the form validation.

Link to comment
Share on other sites

You can set up another ajax to get the results back from the database.  If you are looking to update a form using the results, dont use innerHTML, just reference each item in the form with javascript:

 

<body>

<form name="myForm">

<input type="text" name="myText" />

</form>

<body>

 

document.myForm.myText.value=ajaxResult();

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.