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> Link to comment https://forums.phpfreaks.com/topic/129429-solved-calenderpopup-doesnt-load/ 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>"; ?> Link to comment https://forums.phpfreaks.com/topic/129429-solved-calenderpopup-doesnt-load/#findComment-671055 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. Link to comment https://forums.phpfreaks.com/topic/129429-solved-calenderpopup-doesnt-load/#findComment-671057 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>"; ?> Link to comment https://forums.phpfreaks.com/topic/129429-solved-calenderpopup-doesnt-load/#findComment-671071 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>'; ?> Link to comment https://forums.phpfreaks.com/topic/129429-solved-calenderpopup-doesnt-load/#findComment-671075 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">'; Link to comment https://forums.phpfreaks.com/topic/129429-solved-calenderpopup-doesnt-load/#findComment-671088 Share on other sites More sharing options...
Xtremer360 Posted October 21, 2008 Author Share Posted October 21, 2008 Thank you. Link to comment https://forums.phpfreaks.com/topic/129429-solved-calenderpopup-doesnt-load/#findComment-671099 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.