Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Custom HTML behavior

Posted on 2010-08-12
8
Medium Priority
?
256 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 84

Accepted Solution

by:
Dave Baldwin earned 84 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:Gurvinder Pal Singh
Gurvinder Pal Singh earned 168 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 248 total points
ID: 33428388
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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 248 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:Gurvinder Pal Singh
Gurvinder Pal Singh earned 168 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 248 total points
ID: 33429134
I cannot imagine an externally loaded file applying event handlers is faster than inline/jQuery
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Several part series to implement Internet Explorer 11 Enterprise Mode
Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
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.
Shows how to create a shortcut to site-search Experts Exchange using Google in the Chrome browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch the Search Engine Menu: In chrome, via you…

618 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