Alright, basically I've got a php page we'll call form.php. This page contains a form with a date selector, time selector and textbox (input type="date" input type="time" input type="textarea"). When the user submits the form, the information is sent to the mysql database, and outputted on the next page "display.php".
All of this works perfectly fine. The display.php page is made from the code within form.php
ie. <h1>This is the header</h1>
<h2 class="date">$date</h2>
<h3 class="time">$time</h3>
<p class="message">$message</p>
The output in display.php is
This is a header
2012-04-23
00:59
My message
a button (just to check my work currently)
I am trying to use jquery like so
$(document).ready(function(){
$('button').mousedown(function(){
if ($('h3').text() == "00:59") {
alert("Yup"); return true;}
else { alert("Nope");return false;};
});
});
This will not work to match the time, the date, or the message. If I run the exact same code but search for the h1 that wasn't created with a variable, that will work ie.
$(document).ready(function(){
$('button').mousedown(function(){
if ($('h1').text() == "This is a header") {
alert("Yup"); return true;}
else { alert("Nope");return false;};
});
});
I can't figure out what I'm missing here.
I can even change the h1 to 00:59, run the jquery searching for h1 == "00:59" and it will return true and pass the alert.
It's when I go after the h2, h3, and p elements that were created from the php variables ($time, $date, $message)
Any help would be much appreciated.