javascript submit?

  •  07-01-2005, 11:22 AM

    javascript submit?

    how do i go around this?
    i have a little javascript in the head of the document checking to make sure the form fields are being filled in before the submit.
    The submit button then doesnt do a submit action, instead it runs the javascript checker which then submits the form if textboxes have been filled out.
     
    This used to work with htmlarea, but for the life of me i cannot get it to work with Cute. If i just do a normal html submit with the button it works.
     
    Here is the code sample:
     
    #####THE JAVASCRIPT CHECK
    function check() {
       okSoFar = true;
       check1 = document.insertlocation.lid.value;
       check2 = document.insertlocation.ledscription.value;
    if ((check1 == "") || (check2 == ""))
    {alert("You need to enter some values to submit.");
    okSoFar=false;
    }
     //-- If all fields OK go ahead and submit the form and put up a message.
      if (okSoFar==true) {
     document.insertlocation.submit();
      }
    }
     
    #####Cute area code
            <%
           dim content
           content = ""
           Dim editor
           Set editor = New CuteEditor  
           editor.ID = "ledscription"
           editor.EditorBodyStyle="font-family:Verdana,sans-serif;font-size:10px;"
           editor.Text = content
           editor.FilesPath = "/editor_cute/CuteEditor_Files"
           editor.ImageGalleryPath = "/images/resource"
           editor.DocumentPath = "/images/resource"
           editor.MaxImageSize = 1000
           editor.AutoConfigure = "Simple"
           editor.Width = 600
           'editor.Height = 240
           editor.EditorWysiwygModeCss = "/styles/key2.css"
           editor.UseRelativeLinks = true
           editor.Draw()
           ' Request.Form(ID) access from other page
          %>

    #########SUBMIT BUTTON
    <input name="Add Hotel" type="button" class="formElements" onClick="MM_callJS('check();')" value="Add New" >
     
View Complete Thread