开发者

about html input tag

I know almost nothing about html and javascript. So pardon me if this is a silly question.

For a html input tag like this:

<input name="search1$btnSearch" id="search1_btnSearch" style="background-color: white;" type="submit" value="search"/>

What's gonna happen when this button is clicked?

I looked in all the .js files that are referenced by the page that contains th开发者_StackOverflow中文版is input tag, but I did not find any code that responds to it. So how can I locate the code that responds to this button's click event?

By the way, I think the web site that contains this input tag is built with asp.net, because the pages have a .asxp extension.

Thanks.


This will likely submit a form to search something on the site.

Check the form tag in the html to see what file is referenced.

<form action="form_action.asp">

The action references the file.


It is used to submit a form created with the help of form tags and input elements.


What's gonna happen when this button is clicked?

Since it is a submit button, in the absence of any JS that overrides the normal functionality, it will submit the form.

I looked in all the .js files that are referenced by the page that contains this input tag, but I did not find any code that responds to it.

There might still be some.

So how can I locate the code that responds to this button's click event?

If it exists, it will likely show up if you turn on profiling in your JS debugger (make sure it is configured not to reset when you leave the page (which submitting the form will do)).


It submits the form it is in. This is HTML default and doesn't need Javascript.


Without being able to see the .js files associated with the code it is impossible to tell. But there are a few possibilities.

  1. There is no JS attached and it simply submits the form to the server for processing.
  2. There is JS attached to the input element itself, in which case you would look for code like $('#search1_btnSearch').click(function(){...
  3. There is JS attached to the onsubmit event of the form itself, in which case you would just look for submit event handlers.

You can dig deeper into this code yourself by downloading the Firebug plugin for Firefox which allows you to easily browse and manipulate HTML, JS, CSS, and more.


Most probably (IF THERE IS ANY javascript) the JS event is binded to "search1_btnSearch". Use ctrl + f and search for "search1_btnSearch". BTW: Why do you think that there is javascript involved ? what happens? The standard behaviour without javascript is to submit the form, in which this submit button is embedded.


Nothing as far as I see
May be it is attached with a form that has some action defined and a method also. So that will decide about the action.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜