Solved

passing data from PHP to jQuery function...

Posted on 2014-12-12
2
296 Views
Last Modified: 2014-12-12
Hello, I have a PHP application that I pass data to a jQuery function. My query runs correctly when I pass a single string, example "completed", but if I pass a value like "Not Done", my script does not run. The snippet of my scripts are as follows:

Jquery:

$("#dialog").load("index.php?action=" + $(this).data("id"), function() {

PHP:
<td><input  name="radio" type="radio" data-id="<?=$st;?>"</td>

What change do I make  so my script processes a value like "Not Done"? Thank you.

A
0
Comment
Question by:aej1973
2 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 40496717
Since you haven't said what is what I'm guessing here

$("#dialog").load("index.php?action=" + encodeURIComponent($(this).data("id")), function() { 

Open in new window

0
 

Author Comment

by:aej1973
ID: 40496727
Perfect! Thank you.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
These days socially coordinated efforts have turned into a critical requirement for enterprises.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now