Solved

I have an HTML  check box legend that I need  to convert to PHP,  PHP does not recognize the  checkboxes and fires all the time.

Posted on 2015-02-17
2
79 Views
Last Modified: 2015-02-25
PHP ignores change and check box and runs all the time.

$("#cbType3").change(function(){
            if ($(this).prop("checked")){
            <?php $_SESSION['queryselected'] = 'acutenoncustomer';      ?>
            }else{
            }
});
0
Comment
Question by:TimothyPowell
2 Comments
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 40613857
In your code above, the PHP line will Always run because it is run on the server and the jQuery is run in the browser After the PHP code is run on the server.  While you can insert a value in a javascript with PHP, you can't do the other way around.
0
 
LVL 108

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 40613922
If you're new to PHP and want some learning resources, this article may be able to help.
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_11769-And-by-the-way-I-am-new-to-PHP.html
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

911 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

21 Experts available now in Live!

Get 1:1 Help Now