www.webdeveloper.com
Results 1 to 4 of 4

Thread: integrating javascript with current php

  1. #1
    Join Date
    Jan 2007
    Posts
    20

    integrating javascript with current php

    i have an intranet based on php, this includes forms and such.
    I want to perform javascript validation before a php script is called to submit the information into a mysql database.
    can any one help me

    eg
    if(isset($add)
    {
    $strQuery = "insert into ...";

  2. #2
    Join Date
    Mar 2006
    Posts
    163
    Explain better. What kind of validation? Input validation? Submit validation or what?

  3. #3
    Join Date
    Dec 2006
    Location
    Escaz˙ (Costa Rica) and Mallorca (Spain)
    Posts
    3,234
    Take a look at this page. It'll get you started.

    http://www.w3schools.com/js/js_form_validation.asp

  4. #4
    Join Date
    Mar 2006
    Posts
    163
    I have once used JS with php before and this is how I wrote it.

    <?php if(!empty($_SESSION['reply'])){ ?>
    <script language="javascript">
    alert("<?php echo $_SESSION['reply']; ?>");
    </script>
    <?php
    }
    $_SESSION['reply'] = "";
    ?>

    I guess that looks much simple but with it you should be able to grab an idea.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles