javascript

IE not passing @ symbol for email input on GET form

Hi guys, I'm trying to pass an email through a GET form, but in IE, it strips out the @ symbol on the page with the GET parameters. I'm using an onSubmit event, but all those do is validate the data before letting them submit, it doesn't touch any of the form values. <form name="quick" id="ex" action="order" autocomplete="off" method="G...

periodically_call_remote: Rails AJAX for a facebook app

hi! i'm building a RoR app for facebook using FBML and the Prototype JavaScript library. what i'm trying to do is have a div automatically refreshed, using the neat periodically_call_remote, which creates a PeriodicalExecuter object. here's the code: <%= render :partial => "status_item", :collection => @status %> <%= periodically_...

Best way to check a form for required fields?

Just a brief best-practices question: what is the best way to do required field checking for a form? I see 3 choices: Server side. reload the page with an error message. Javascript (Client-side) for user-friendly non-reloading, also duplicate requirements on server side and sanitize input. AJAX - best of both worlds, use JS to ask the...

Country/State Dynamic Drop Down List

If you go to http://profile.microsoft.com and edit your personal information, you will select your country. When a country is selected the city and/or state information changes based on what is expected for that country. Does anyone have any examples on how to accomplish this? Is there any service (free service) that provides this inform...

Thinking of new way of building a db page populating data via api calls - are there any issues doing it this way

Up to know, for DB driven web sites, I've used php (and CodeIgniter) to populate the data within the page prior to rendering, what I'm thinking about doing now is to develop a javascript (via jquery) page, make it as interactive as possible and then connect to the db through ajax/json calls - so NO data populated to the screen prior to r...

How do I trigger the browser context menu on an element. (As if the user right-clicked)

I have the need to trigger the opening of the browser (IE, Firefox, Safari, etc) context-menu via javascript. The problem I am trying to solve, is when an overlaid element is right-clicked, the element below it shows its context menu. So if the top element is a label, when you right click, I need to show the context menu for the input el...

What is the correct/safest way to escape input in a forum?

I am creating a forum software using php and mysql backend, and want to know what is the most secure way to escape user input for forum posts. I know about htmlentities() and strip_tags() and htmlspecialchars() and mysql_real_escape_string(), and even javascript's escape() but I don't know which to use and where. What would be the safe...

PHP or Javascript which to learn first ?

As the title says in your opinion which should I learn first PHP or Javascript. I am going to learn both but which order do you feel I should learn them in? ...

Convert time in PHP or Javascript?

I am curious which is the best way to convert time like this 2008-04-23 into 1 year and 3 days ago I currently do this in PHP but I am finding a lot of sites do it in javascript, including Stackoverflow What do you think is the best way, it seems offloading it to the browser with javascript would just slow your app down, yes the big bo...

Why doesn't this drop down menu work?

Hello! I've download the Refresh template by Styleshout.com since I really like it. But unfortunately, there was no drop down menu in it, only a normal menu. So I tried to integrate a drop down menu which I found a nice tutorial for. It does almost work - almost. Here's the result: the template on my webspace. The menus are opened - ...

Tree Menu Won't Scroll

I have a nested list that lists child nodes when the parent node is expanded. The parent node is expanded by clicking an image to the left of the text. Unfortunately, it expands right off the page. I would like a scrollbar to appear when the content is off the page. When I set "overflow: auto", a scrollbar never pops up, it just ...

jquery - pass text on the page into a dialog

i want to have a link and have it call a javascript function but i want to pass the text of the link into the function. i am trying to create a dialog that displays the name on the original link. would jquery be helpful here? ...

jquery UI Tabs using DIV instead of UL for navigation

Hi Im a little new to JS and this has got me scratching my head like crazy. I want to use a DIV with a bunch of anchors inside for the navigation instead of the mandatory (I think?) UL. I have found the piece of code that does this, but I can't seem to make any sense of it. this.list = this.element.children('ul:first'); this.lis = $...

What programming challenge you can administer to a HTML/JavaScript/CSS candidate?

We are in the process of hiring a HTML/JavaScript/CSS web developer, and we are looking for an objective programming homework that they are able to complete 24 hours before the actual interview. There are few questions in SO about programming homework but nothing related specifically to HTML/JS/CSS. Ideas? Reference 1 Reference 2 ...

dynamic table where i can click on link and grab contextual information

i am generated a table dynamically which looks like this: Name Action ==== ======= Adam Delete Joe Delete Bill Delete I want "Delete" to be a link that pops up a confirmation popup that says: "Are you sure you want to delete "Adam"? (Yes, No) NOTE that "adam" is contextual and needs to be retrieved from the ro...

html grid, and I need to submit the data from the one row the user clicked to a cgi

I need to create a grid of data many rows by 8 columns. When the user clicks on a row I need to submit the data from only that row to a php program. I'm not sure how to proceed. Do I make each row a separate form? Do I create a hidden form and copy the row data into it, and submit that? I'm not sure how to determine which row the user ...

JQuery closest() help

So I have several containers with this markup on a page: <div class="box w400"> <div class="box-header"> <span class="expand-collapse">expand/collapse</span> <h3>Heading</h3> </div> <div class="box-content"> <p>Some content here...</p> ...

Copy to clipboard using Javascript

I want to be able to copy text to the clipboard using Javascript. I found the JQuery Copy plugin on the web but this does not work in Firefox (after testing it only IE). I found another one called ZeroClipboard but this seems to rely on Flash player 9 and 10. Is there any other solution that will work in all browsers? ...

What are the arguments against using a JavaScript Framework for a Web site development company?

Our company builds websites and web applications. We are a small firm and our team of developers are always building the javascript functions from scratch or copying from other websites built by us. Every time I bring to the table the word standardization and using a JS framework like JQuery, Prototype or any other, I am told Framework...

Mocking functions with custom argument matchers in JSMock

I was reviewing JSMock, and admittedly the most complete documentation I've found are the examples at http://jsmock.sourceforge.net/examples/. I have some questions about argument matching. The example at http://jsmock.sourceforge.net/examples/ demonstrates argument matching using the TypeOf.isA(). I wonder, are there any other matc...