Solved

Custom HTML behavior

Posted on 2010-08-12
8
248 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 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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This article offers some helpful and general tips for safe browsing and online shopping. It offers simple and manageable procedures that help to ensure the safety of one's personal information and the security of any devices.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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.

828 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