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 2 of 2
  1. #1
    New Coder
    Join Date
    May 2007
    Posts
    47
    Thanks
    5
    Thanked 1 Time in 1 Post

    Determine which form item changed?

    Sample code:
    Code:
    <html>
    <body>
    	<form name="myform" action="index.asp" method="post">
    		<select name="myselect1" onchange="document.myform.submit();">
    			<option>1</option>
    			<option>2</option>
    		</select>
    
    		<select name="myselect2" onchange="document.myform.submit();">
    			<option>1</option>
    			<option>2</option>
    		</select>
    	</form>
    </body>
    </html>
    I potentially have many selects. After it has been submitted, how can I determine which one was changed?

  • #2
    New Coder
    Join Date
    Jun 2005
    Location
    Blackpool. UK
    Posts
    98
    Thanks
    0
    Thanked 4 Times in 4 Posts
    Add a hidden field with the original value of each option and compare them.

    OR

    Put the original values in session variables and compare them.


  •  

    Posting Permissions

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