Solved

Custom HTML behavior

Posted on 2010-08-12
8
251 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

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

Do you come here a lot? Are you lazy like me and don't want to go through the "trouble" of having to click your Dock's Safari icon and then having to click your Experts Exchange Favorites bookmark to get here? Well then this article is for you.
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…
Google currently has a new report that is in beta and coming soon to Webmaster Tool accounts. This Micro Tutorial will highlight new features for Google Webmaster Tools.
This Micro Tutorial will demonstrate how nuggets on the Web are formatted by using Chrome Developer Tools. These tools would not only view the site's CSS but it can also modify it and save the CSS to use on your own site.

726 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