Results 1 to 3 of 3

Thread: submit javascript question w/ forms

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2000
    Posts
    537
    ok,this works
    <a href="somepage.htm" onClick="javascript:document.myForm.submit();">submit</a>

    but I need to run use a confirm box before I submit the form.

    so I am trying this:

    <script>
    function ConfirmDelete()
    {
    if (!confirm)
    {return false;}
    else
    {document.myForm.submit;}
    </script>

    I don't get an error message but it dosen't submit the form either.

    I tried to use location.href but i need to pass some name/value pairs and i couldn't get the variables into my javascript from the asp.


    any suggestions?

    thanks
    pnj

  2. #2
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    function PrintConfirm()
    {
    var agree=confirm("Are you sure you wish to do this?");

    if (agree) {

    document.myForm.submit();
    }
    else {
    return false; }
    }
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2000
    Posts
    537
    i got it.
    i was doing it with
    <a href="#" onClick="callFunction">

    and it needed to be

    <a href="javascript:callFunction">

    this works.

    whoo-ho!
    pnj

Posting Permissions

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



Click Here to Expand Forum to Full Width