javascript

Check if web form values has changed. Best practice

Hello everybody, I have multi-step form and user can navigate to any page to modify or add information. There is a menu that shows progress and steps user completed. This menu allows to navigate to any step user completed or going to complete. Inspite of big button "Save and Continue" some users click this menu to navigate further. I ...

jquery set focus on dynamic content?

In jquery I've appended a <li> element to an unordered list. How do I focus on the newly created <li> ? If I do the following: $("ul").append('<li><input type="text" value="Hi!"></li>'); $("li:last").focus(); //doesn't work because new <li> isn't in dom yet the focus doesn't work, as noted above. I know jquery 1.4.2 has a live() ev...

Submit A Form Using Javascript

<form action="/?wpmlmethod=offsite&amp;list=2&amp;wpmlformid=" method="post"> ... </form> I tried: <script type="text/javascript">document.forms[0].submit();</scrpit> But it didn't work. ...

"Constrained" HTML textarea/WYSIWYG editor?

I am looking for a web-based JavaScript <textarea> editor with support for standard features like selectable font, text colour, paragraph alignment etc. However, there is one considerable constraint: Formatting should always apply to all the text, not parts of the text. That is, the user is able to colour all of his text red, or all of h...

What is the name of google chrome rss plugin?

I want to detect if the user has already installed google chrome rss plugin or not. I want to do this using javascript like this : if (navigator.plugins[rss_chrome_plugin _name]) { // do some stuff if it is installed } The problem is that I don't know the name of the plugin.Any help? ...

jquery array checkbox

var others = $("#6"); others.click(function() { $('input:checkbox').attr('checked',false); $("#6").attr('checked',true); }); I have an array of check boxes which is drawn from database. I want to uncheck other check boxes when a certain check box is ticked in my case checkbox with id #6, and it uncheck a checkbox #6 if other ch...

Help write regex that will surround certain text with <strong> tags, only if the <strong> tag isn't present

I have several posts on a website; all these posts are chat conversations of this type: AD: Hey! BC: What's up? AD: Nothing BC: Okay They're marked up as simple paragraphs surrounded by <p> tags. Using the javascript replace function, I want all instances of "AD" in the beginning of a conversation (ie, all instances of "AD" at the s...

Trigger the change event of a textbox in jQuery

I have an asp:TextBox with asp:RegularExpressionValidator to validate if it's a number. Obviously an onchange event will be attached to this textbox while rendering. Also I add a change event at $(document).ready to make some calculation when the value is changed. <asp:TextBox id="myText" runat="server" /> <asp:regularexpressionvalidato...

Developing a myspace application with .NET back end - Help

Okay, so here z the scenario, I have to create a myspace application which will have a .NET backend. from my current research n all I have found that this shud be my architecture: A .NET application which uses handlers and the handlers use a function to write the output in an XML file on the server A javascript front end for the myspac...

Results page in other window.

I have this simple form: <form method="post" action"."> <input type="text" name="title"> <input type="submit" name"send"> </form> I want that when a user click on submit, then will be open another window of browser with the results. Is it possible ? ...

how to write javascript in asp.net in code behind using C#

Greetings, how can I write JavaScript code in asp.net in code behind using C#. For example, I have click button event when I click the button I want to invoke this java script code: alert("You pressed Me!"); I want to know how to use java script from code behind. Thank you; ...

HtmlUnit doesn't load externally referenced javascript

I have run into a problem while trying to test a web application with HtmlUnit. Please bear in mind that I haven't used HtmlUnit very long so I might be missing something trivial. For some reason externally referenced javascripts aren't being loaded. When I print the page as xml all i get is this: <script language="javascript" src="url...

Count bytes in textarea using javascript

I need to count how long in bytes a textarea is when UTF8 encoded using javascript. Any idea how I would do this? thanks! ...

Javascript Class using the window.onunload event

Hi All, I have a javascript class with methods and properties. Is it possible to wire this class up to a pageunload event? I am trying to call a method in my class when the user moves pages. How can I do this. Thanks ...

Use onclick event when JS is enabled, navigate to a URL when it's not

Facebook uses Ajax links to change parts of their pages in order to keep the load time down. But if you disable JavaScript, their links still work. That's because they've also defined a backup option: the classic <a href="http://url/". How can I implement this myself so that the link will be followed when JS is disabled and the onclick ...

Inserting Struts Tiles attribute into a JavaScript function

Hi, I'm trying to insert a Struts Tiles attribute into a JavaScript function. The JS function is called on load and certain JSP pages should be allowed to append additional code to that function. The template looks like this: <html> <head> <script> function onLoad(){ ... <tiles:insert attribute="html.head.onLoad" ignore="tru...

google maps plot route between two points

I have written this innocent javascript code, which lets the user create two markers and plot the route between them. It doesnt work, instead, it gives a weird error: Uncaught TypeError: Cannot read property 'ya' of undefined Can someone suggest me whats wrong here: // called upon a click GEvent.addListener(map, "click", function(ove...

How to return radio checked object with jQuery ?

HTML <input type="radio" name="rdName" id="uniqueID1" value="1" checked="checked"> <input type="radio" name="rdName" id="uniqueID2" value="2"> <input type="radio" name="rdName" id="uniqueID3" value="3"> jQuery #1 $('input:radio[name=rdName]:checked').val(); jQuery #2 $('input[name=rdName]:checked'); jQuery #1 gets the value of c...

Why its recommended not use onclicks in your HTML.Use Event Handlers in your JS file

Why its recommended not use onclicks in your HTML.Use Event Handlers in your JS file is considered as best practice??? ...

Html combo box to database record Id

I'm fairly sure there has to be a simple solution to my problem, but I am a new web developer and can't quite figure it out. On my page I have a combo box whose values are filled from my database. When the user submits the form, how to I go about converting those values back to the record numbers in the database? Up to now I have been ...