Solved

Custom HTML behavior

Posted on 2010-08-12
8
250 Views
Last Modified: 2013-12-08
Can I use custom behavior to create two elements on the HTML form, e.g. input item and an image <input> and <a>.  
Can I overide default behavior.
Please provide example.
0
Comment
Question by:intellias_net
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 21 total points
ID: 33425930
HTML is not a programming language like that.  Javascript can be used to Add behavior to some HTML elements.  The closest you get to 'overriding' the behavior of an element is to create a javascript that returns 'false' so the action doesn't happen.  Other than that, you have to use what is already defined.

Even server-side languages like ASP and PHP don't change how HTML works, they just add other functions to the server processing of the page and forms.
0
 
LVL 40

Assisted Solution

by:gurvinder372
gurvinder372 earned 42 total points
ID: 33427401
<<Can I overide default behavior.>>
what exactly do you mean? what behavior you want to override?
0
 
LVL 75

Assisted Solution

by:Michel Plungjan
Michel Plungjan earned 62 total points
ID: 33428388
0
SuperAntiSpyware Licenses Discounted by 25% !

Exclusive offer to Experts Exchange Members!
Buy SuperAntiSpyware License(s) from us and save 25% on the regular purchase price.
- Includes Full SuperAntiSpyware Vendor Support Entitlements
- Your Subscription does not begin until you activate your license
- Buy for your friends

 

Author Comment

by:intellias_net
ID: 33428435
I was looking at behaviors to modify events such as onchange, onclick onfocus.  
I was also looking to modifiy whats placed on the form so that if an element is put on the form, two elements are placed (input box and button).  The combined objects would operate as one.  
0
 
LVL 75

Assisted Solution

by:Michel Plungjan
Michel Plungjan earned 62 total points
ID: 33428498
You need to be more specific.

For example .NET has several widgets that will do what you mention
jQuery and other frameworks also can do such things.

Most event handers can be overridden by javascript

0
 
LVL 40

Assisted Solution

by:gurvinder372
gurvinder372 earned 42 total points
ID: 33428550
<<I was looking at behaviors to modify events such as onchange, onclick onfocus.  >>
Can you give an example, as to what do you want to modify?
You can always capture the generated event and trigger the different one programatically.
http://www.guahanweb.com/2010/03/02/how-to-manually-trigger-events-in-javascript/

Or you want to trigger custom events?
http://www.truerwords.net/articles/web-tech/custom_events.html
http://www.howtocreate.co.uk/tutorials/javascript/domevents

<<I was also looking to modifiy whats placed on the form so that if an element is put on the form, two elements are placed (input box and button).  The combined objects would operate as one.  >>
what do you mean by saying combined object operate as one?
0
 

Author Comment

by:intellias_net
ID: 33429117
Does anyone know if I use behaviors (*.htc) to define events such as onfocus, as compared to dynamically defining onfocus (element.onfocus=) is faster to build up a form?
0
 
LVL 75

Assisted Solution

by:Michel Plungjan
Michel Plungjan earned 62 total points
ID: 33429134
I cannot imagine an externally loaded file applying event handlers is faster than inline/jQuery
0

Featured Post

SuperAntiSpyware Licenses Discounted by 25% !

Exclusive offer to Experts Exchange Members!
Buy SuperAntiSpyware License(s) from us and save 25% on the regular purchase price.
- Includes Full SuperAntiSpyware Vendor Support Entitlements
- Your Subscription does not begin until you activate your license
- Buy for your friends

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question