# Call java function from php

**URL:** <https://forum.kirupa.com/t/call-java-function-from-php/332423>\
**Category:** Uncategorized\
**Created:** [June 4, 2014, 6:10pm UTC](https://forum.kirupa.com/t/call-java-function-from-php/332423 "2014-06-04T18:10:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dasLuft](https://avatars.discourse-cdn.com/v4/letter/d/f05b48/32.png) [@dasLuft](https://forum.kirupa.com/u/dasLuft)\
**Post date:** [June 4, 2014, 6:10pm UTC](https://forum.kirupa.com/t/call-java-function-from-php/332423/1 "2014-06-04T18:10:57Z")

</div>

Hi! How do I run this js function:

```auto
<script type="text/javascript">function invalidContact() {
    document.getElementById( 'contact' ).scrollIntoView();    
};
</script>

```

from here:

```auto
if(isset($_POST['submitted']))
{
   if($formproc->ProcessForm())
   {
       header("Location: http://websiteetc.html");
   }
else
{
invalidContact();
}
}

```

Its for a contact form if the fields return errors.I need it to scroll to the contact.

Thanks!
