0
votes

I need to modify few feature to a classic ASP page what has 7k+ line of code. In existing code, it has the following HTML code:

<input class="submit" type="submit" name="submit_addupdate" value="Submit">

The "Submit" button works fine with existing feature. But, this submit button doesn't response if I add "id" property to the above tag as follows:

<input class="submit" type="submit" name="submit_addupdate" id="submit_addupdate" value="Submit">

I could not find the cause why it doesn't work if I add same ID property as Name property. Though other classic ASP pages work fine with similar submit button with ID.

Please note that it also works if I write code with different ID property as follows:

<input class="submit" type="submit" name="submit_addupdate" id="submit_addupdate1" value="Submit">

Please let me what the probable cause might be.

1
it does not work is quite unspecific... have you got any further information. in my company we also have quite a bit of asp running and HTML-Code like yours works well..-Vogel612
There could be a number of issues here as pointed out by Vogel612. Have you tried tracing your code out by searching for the various locations of submit_addupdate? Also, have you checked the method of your form? You'll most likely need POST if you're going to work with the form data in that way.Paul

1 Answers

1
votes

Having same ID to more than one HTML element is invalid. Each browser deals with invalid HTML in its own way, but such HTML is prone to problems and won't work as expected.

From what you wrote sounds like you have that line in a loop or have it more than once, so make sure you give unique ID each time.