Xtremer360 Posted October 21, 2008 Share Posted October 21, 2008 Does anyone know why when I click on Date Selector it won't pop up with the CaldenderPopUp? It just doesn't so anything. print '<SCRIPT LANGUAGE="JavaScript" SRC="CalendarPopup.js"></SCRIPT>'; print '<SCRIPT LANGUAGE="JavaScript"> var cal = new CalendarPopup(); </SCRIPT>'; Date:<input type="text" name="date" readonly="readonly" /> <a href="#" onClick="cal.select(document.forms[\'form1\'].date,\'anchor1\',\'MM/dd/yyyy\'); return false;"NAME="anchor1" ID="anchor1">Date Selector</a> Quote Link to comment Share on other sites More sharing options...
MadTechie Posted October 21, 2008 Share Posted October 21, 2008 Okay this has nothing to do with PHP.. try the HTML/CSS/Javascript section.. but it looks like your missing the form tag.. and a print command try this <?php print '<SCRIPT LANGUAGE="JavaScript" SRC="CalendarPopup.js"></SCRIPT>'; print '<SCRIPT LANGUAGE="JavaScript"> var cal = new CalendarPopup(); </SCRIPT>'; print "<form>"; print 'Date:<input type="text" name="date" readonly="readonly" />'; print '<a href="#" onClick="cal.select(document.forms[\'form1\'].date,\'anchor1\',\'MM/dd/yyyy\'); return false;"NAME="anchor1" ID="anchor1">Date Selector</a>'; print "</form>"; ?> Quote Link to comment Share on other sites More sharing options...
Xtremer360 Posted October 21, 2008 Author Share Posted October 21, 2008 I do have it that was just the parts that I though were importnat to put into the post. Quote Link to comment Share on other sites More sharing options...
MadTechie Posted October 21, 2008 Share Posted October 21, 2008 Okay well this should work, try this in its own file (make sure you have the JS in the same folder) <?php echo "<SCRIPT LANGUAGE=\"JavaScript\" SRC=\"CalendarPopup.js\"></SCRIPT>"; echo "<SCRIPT LANGUAGE=\"JavaScript\"> var cal = new CalendarPopup(); </SCRIPT>"; echo "<form name=\"form1\">"; echo "Date:<input type=\"text\" name=\"date\" readonly=\"readonly\" />"; echo "<a href=\"#\" onClick=\"cal.select(document.forms['form1'].date,'anchor1','MM/dd/yyyy'); return false;\" NAME=\"anchor1\" ID=\"anchor1\">Date Selector</a>"; echo "</form>"; ?> Quote Link to comment Share on other sites More sharing options...
Xtremer360 Posted October 21, 2008 Author Share Posted October 21, 2008 Here's all my code: <?php print '<center><caption><strong>Add A Show</strong></caption></center>'; print '<SCRIPT LANGUAGE="JavaScript" SRC="CalendarPopup.js"></SCRIPT>'; print '<SCRIPT LANGUAGE="JavaScript"> var cal = new CalendarPopup(); </SCRIPT>'; print '<form enctype="multipart/form-data" method="post">'; print '<input name="MAX_FILE_SIZE" type="hidden" value="100000">'; print '<table border="1" style="margin: auto; width: 60%;">'; print '<tr><td>Show Type:</td> '; print '<td><select name="type"><option value="">Select a Show Type</option>'; $query = 'SELECT type FROM showtypes ORDER BY type'; $result = mysql_query($query); while ($row = mysql_fetch_assoc($result)){ echo "<option value=\"{$row['type']}\">{$row['type']}</option>\r"; } print '</select></td></tr>'; print '<tr><td>Show Name:</td> '; print '<td><input name="showname" type="text"></td></tr>'; print '<tr><td>Location:</td> '; print '<td><input name="location" type="text"></td></tr>'; print '<tr><td>Arena:</td> '; print '<td><input name="arena" type="text"></td></tr>'; print '<tr><td>Date:</td><td><input type="text" name="date" readonly="readonly" /> <a href="#" onClick="cal.select(document.forms[\'form1\'].date,\'anchor1\',\'MM/dd/yyyy\'); return false;"NAME="anchor1" ID="anchor1">Date Selector</a></td></tr>'; print '<tr><td>Show Image:</td> '; print '<td><input name="uploadedfile" type="file"></td></tr>'; print '<tr><th colspan=2><input type="submit" name="submit" value="Add Show Name" /><input name="sumbitted" type="hidden" value="TRUE"></th></tr></table></form><br><br><br>'; ?> Quote Link to comment Share on other sites More sharing options...
MadTechie Posted October 21, 2008 Share Posted October 21, 2008 print '<form enctype="multipart/form-data" method="post">'; to print '<form enctype="multipart/form-data" name="form1" method="post">'; Quote Link to comment Share on other sites More sharing options...
Xtremer360 Posted October 21, 2008 Author Share Posted October 21, 2008 Thank you. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.