Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > JSP Basics
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
JSP Basics Beginning-level questions on JSP. More advanced coders should post to Pro JSP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the JSP Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Closed Thread
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 27th, 2004, 12:40 AM
Authorized User
 
Join Date: Apr 2004
Location: malacca, malacca, Malaysia.
Posts: 69
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to junemo
Default document.forms[0].submit()-not function??

hi, i hope somebody can help me solve this problem. when i write <a href="javascript: document.forms[0].submit()">Add</a> in my php project but why it can't display the info that i add before in the same form?
attach code:
<?php
    #generating session and session id
    session_start();
    $sid = session_id();

    include("html.php");

    #dislaying HTML header
    echo $head;

    #unserializing data
    $pos = unserialize($poss);
    $stocka = unserialize($stocks);
    $qtya = unserialize($qtys);
    $uoma = unserialize($umos);
    $pricea = unserialize($prices);
    $amounta = unserialize($amounts);

    #checking, if data has been pased to the form

    if (strlen($invno) > 0)
    {
        $sinvno = $invno;
        session_register("sinvno");
    }

    if ($newstock && ($newstock != ''))
    {
        $count++;
        session_register("count");

        $posa[$count] = $newpos;
        $poss = serialize($posa);
        session_register("poss");

        $stocka[$count] = $newstock;
        $stocks = serialize($stocka);
        session_register("stocks");

        $qtya[$count] = $newqty;
        $qtys = serialize($qtya);
        session_register("qtys");

        $uoma[$count] = $newuom;
        $uoms = serialize($uoma);
        session_register("uoms");

        $pricea[$count] = $newprice;
        $prices = serialize($pricea);
        session_register("prices");

        $amounta[$count] = $newamount;
        $amounts = serialize($amounta);
        session_register("amounts");
    }

        # drawing the table

        drawlines($count, $posa, $stocka, $qtya, $uoma, $pricea, $amounta);

        # generate an input line

        inputline();

        # displaying end of HTML code

        echo $tail;

    # add lines containing data to the table

    function drawlines($count, $posa, $stocka, $qtya, $uoma, $pricea, $amounta)
    {
        for ($i = 1; $i <= $count; $i++)
        {
            echo "<tr><td>$i</td><td>".$posa[$i]."</td>;
            echo "<td>".$stocka[$i]."</td>";
            echo "<td>".$qtya[$i]."</td><td>".$uoma[$i]."</td>";
            echo "<td>".$pricea[$i]."</td>";
            echo "<td>".$amounta[$i]."</td></tr>\n";
        }
    }

    # edit the inputline to the data

    function inputline()

    {
        echo '<tr><td>
            <a href="javascript: document.forms[0].submit()">Add</a>

            </td>
            <td><input type="text" name="newpos" style="HEIGHT: 45px; WIDTH: 100px"></td>
            <td><textarea name="newstock" style="HEIGHT: 60px; WIDTH: 415px">
Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple forms one submit x_ray Classic ASP Basics 7 January 3rd, 2006 07:12 PM
cant submit forms rashmid PHP How-To 3 May 29th, 2005 04:34 PM
cant submit forms rashmid HTML Code Clinic 1 May 24th, 2005 05:33 AM



All times are GMT -4. The time now is 01:30 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.