Solved

Custom HTML behavior

Posted on 2010-08-12
8
244 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
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 82

Accepted Solution

by:
Dave Baldwin earned 21 total points
Comment Utility
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
Comment Utility
<<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
Comment Utility
0
 

Author Comment

by:intellias_net
Comment Utility
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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 75

Assisted Solution

by:Michel Plungjan
Michel Plungjan earned 62 total points
Comment Utility
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
Comment Utility
<<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
Comment Utility
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
Comment Utility
I cannot imagine an externally loaded file applying event handlers is faster than inline/jQuery
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

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…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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…
How to create a custom search shortcut to site-search Experts Exchange using Google in the Firefox browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch your Bookmark Menu: Press 'Ctrl +…

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now