PHP Submit Question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mtek

    PHP Submit Question

    Hi,

    In the PHP form for my company, they use an image button to submit the
    form to some javascript for validation, then use the SUBMIT() to
    submit the form. The code is this:

    <TD class="topnav" bgcolor="#00FF0 0"><a
    href="savedata. php" onclick="if ('preventDefaul t' in event)
    { event.preventDe fault(); }
    else { event.returnVal ue = false; }
    formvalidation( document.forms['Add_Data']);">SAVE DATA</
    a></TD>

    Now, they have changed the site and rather than using an image button,
    they are using some CSS to use a position on the background to kick
    off the submit process. The code is similar to above:

    <div class="nextimg" >
    <a id="nextlink" href="savedata. php" onclick="if
    ('preventDefaul t' in event) { event.preventDe fault(); } else
    { event.returnVal ue = false; }
    formvalidation( document.forms['Add_Data']);"></a>
    </div>

    The problem is that whe it hits the SUBMIT() command, it gives an
    'object expected' error.

    Any help or thoughts? This is the way they want it, so this is what I
    have to do. So, if anyone can help me work with this, I'd really
    appreciate it.

    Thank you,

    John
  • Jerry Stuckle

    #2
    Re: PHP Submit Question

    Mtek wrote:
    Hi,
    >
    In the PHP form for my company, they use an image button to submit the
    form to some javascript for validation, then use the SUBMIT() to
    submit the form. The code is this:
    >
    <TD class="topnav" bgcolor="#00FF0 0"><a
    href="savedata. php" onclick="if ('preventDefaul t' in event)
    { event.preventDe fault(); }
    else { event.returnVal ue = false; }
    formvalidation( document.forms['Add_Data']);">SAVE DATA</
    a></TD>
    >
    Now, they have changed the site and rather than using an image button,
    they are using some CSS to use a position on the background to kick
    off the submit process. The code is similar to above:
    >
    <div class="nextimg" >
    <a id="nextlink" href="savedata. php" onclick="if
    ('preventDefaul t' in event) { event.preventDe fault(); } else
    { event.returnVal ue = false; }
    formvalidation( document.forms['Add_Data']);"></a>
    </div>
    >
    The problem is that whe it hits the SUBMIT() command, it gives an
    'object expected' error.
    >
    Any help or thoughts? This is the way they want it, so this is what I
    have to do. So, if anyone can help me work with this, I'd really
    appreciate it.
    >
    Thank you,
    >
    John
    >
    No idea. You haven't shown us any PHP code.

    Or maybe you're in the wrong newsgroup?

    --
    =============== ===
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    jstucklex@attgl obal.net
    =============== ===

    Comment

    • Michael Fesser

      #3
      Re: PHP Submit Question

      ..oO(Mtek)
      >In the PHP form for my company, they use an image button to submit the
      >form to some javascript for validation, then use the SUBMIT() to
      >submit the form. The code is this:
      >
      <TD class="topnav" bgcolor="#00FF0 0"><a
      >href="savedata .php" onclick="if ('preventDefaul t' in event)
      { event.preventDe fault(); }
      else { event.returnVal ue = false; }
      formvalidation( document.forms['Add_Data']);">SAVE DATA</
      >a></TD>
      Ugly. What happens without JavaScript?
      >Now, they have changed the site and rather than using an image button,
      >they are using some CSS to use a position on the background to kick
      >off the submit process. The code is similar to above:
      >
      <div class="nextimg" >
      <a id="nextlink" href="savedata. php" onclick="if
      >('preventDefau lt' in event) { event.preventDe fault(); } else
      >{ event.returnVal ue = false; }
      >formvalidation (document.forms['Add_Data']);"></a>
      </div>
      >
      >The problem is that whe it hits the SUBMIT() command, it gives an
      >'object expected' error.
      >
      >Any help or thoughts? This is the way they want it, so this is what I
      >have to do. So, if anyone can help me work with this, I'd really
      >appreciate it.
      That's more a JS question and has nothing to do with PHP. Additionally
      it's not what I call a proper and reliable form submission method. Forms
      are submitted with a button, not with a link. And validation is done on
      the server, not (at least not only) on the client.

      Micha

      Comment

      Working...