Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Posts
    358
    Thanks
    2
    Thanked 0 Times in 0 Posts

    2 different submit form process...

    dear,

    i have a drop down list, and 1 submit button.
    when i onChange the drop down list, some value may changed on the same page -- called first.asp, the value are store in the Text boxes(more than 5 text boxes). But when i click on the button(named Save button), i will save all the text boxes value into database, but the Add program save into another Asp file -- called second.asp.

    Example:
    <Form name="form" method="post" action="first.asp" onSubmit="return checkform()">
    <table width="80%" border="0" cellpadding="6" cellspacing="1" class="tabletitle" cellpading="1">
    <tr>
    <td><select name="Level1" onchange="document.form.submit()">
    <option value="a,1" selected>-a1</option>
    <option value="b,2" selected>-b2</option>
    <option value="c,3" selected>-c3</option>
    </select>
    <input name="t1" type="text" size="15">
    <input name="b2" type="text" size="15">
    <input name="b3" type="text" size="15">
    <input name="x2" type="text" size="15">

    <input type=submit name=save value=save >
    </form>

    SO, how i can do is when i onChange the drop down list, the page will submit.form then get some value from database and pass to the text boxes. And when i click the Save button the values that store in the text boxes will pass to second.asp to do processing.... how?
    Thanks.
    =====================================================
    From NinjaTurtle
    ++http://ohmygoh.blogspot.com|http://technology.ohmygoh.com++

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,037
    Thanks
    0
    Thanked 250 Times in 246 Posts
    just change the form action:

    <input type="submit" name="save" value="save" onclick="this.form.action='second.asp'">

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Posts
    358
    Thanks
    2
    Thanked 0 Times in 0 Posts
    how if i have 2 functions in the same event?
    example: <INPUT ... onclick="return checkform2();this.form.action='itemLevel2_add.asp'">

    but its not work!!
    Thanks.
    =====================================================
    From NinjaTurtle
    ++http://ohmygoh.blogspot.com|http://technology.ohmygoh.com++

  • #4
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,037
    Thanks
    0
    Thanked 250 Times in 246 Posts
    the 2nd statement will not be executed because of the return in the first statement.
    show us the whole html and javascript codes.

  • #5
    Regular Coder
    Join Date
    Jun 2002
    Posts
    358
    Thanks
    2
    Thanked 0 Times in 0 Posts
    i solve the problem. i plug in the second script to the end of the 1st script. TQ.
    Thanks.
    =====================================================
    From NinjaTurtle
    ++http://ohmygoh.blogspot.com|http://technology.ohmygoh.com++


  •  

    Posting Permissions

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