
phpQuestioner
Members-
Posts
1,485 -
Joined
-
Last visited
Never
Everything posted by phpQuestioner
-
You need to set the entire id with a parameter and then this will work. Example: <script language="javascript"> function readmore(from) { document.getElementById(from).innerHTML = xmlHttp.responseText; } </script> <div id="readmore<?php echo $news['newsid'];?>"><a href="#" onClick="readmore('<?php echo $news['newsid']; ?>'); return false;">Read More</a></div> Do something to this extent and I think it will work the way you want it to.
-
Try this instead and see if this is what your looking for. <script language="javascript"> function lockout() { document.getElementById('clear').disabled = true; } </script> <form action="" method="POST" name="form1"> <input type="text" name="nume" value="nume" onchange="test()"> <input type="submit" name="submit" value="submit" onclick="lockout()"> <input type="reset" name="reset" value="reset" id="clear"> </form>
-
[SOLVED] Radio button changing textboxes value
phpQuestioner replied to PyraX's topic in Javascript Help
Your Welcome PyraX -
Just send them to your tos page; when the click on your forum link or button or however they are accessing you forum. Then add this little snippet of code to your tos page. <h3>Do You Agress To These Terms?</h3> <br/><br/> <input type="button" onclick="document.location.href='http://www.yourdomain.com/forumpagename.php'; return true" value="Yes"> <input type="button" onclick="alert('You Must Except Our TOS Agreement To Use Our Forum')" value="No"> Obviously this is a very simple way to do this, but if you want to make it mandatory that they click "yes"; I suggest you do this differently and use server side scripting to validate their answer. But if you just want to give the a quick "heads up"; this will work just fine.
-
[SOLVED] Radio button changing textboxes value
phpQuestioner replied to PyraX's topic in Javascript Help
Oops - Change the checkbox to a radio button - Sorry - My fault. Like So: <script language="javascript"> function showDetails(val1,val2,val3) { document.getElementById('txt1').value = val1; document.getElementById('txt2').value = val2; document.getElementById('txt3').value = val3; } </script> <input type="radio" onclick="showDetails('Put Value 1 Here','Put Value 2 Here','Put Value 3 Here')"> <br><br> <input type="text" id="txt1"><br> <input type="text" id="txt2"><br> <input type="text" id="txt3"> -
[SOLVED] Radio button changing textboxes value
phpQuestioner replied to PyraX's topic in Javascript Help
<script language="javascript"> function showDetails(val1,val2,val3) { document.getElementById('txt1').value = val1; document.getElementById('txt2').value = val2; document.getElementById('txt3').value = val3; } </script> <input type="checkbox" onclick="showDetails('Put Value 1 Here','Put Value 2 Here','Put Value 3 Here')"> <br><br> <input type="text" id="txt1"><br> <input type="text" id="txt2"><br> <input type="text" id="txt3"> -
I clicked on the url/domain you provided and the domain does not exist. ???
-
You really cannot prevent the: tab, window, or browser from closing. You might find a way to stall it; but the end result would be; if someone really wanted to close your page; they could.
-
Creating the number of entries on the fly.
phpQuestioner replied to jdubwelch's topic in Javascript Help
try this: <script language="javascript"> function addFields(what) { document.getElementById("more").innerHTML=""; var amount = document.getElementById('numTimes').value; var max = amount - 1; for (i=0;i<=max;i++) { document.getElementById("more").innerHTML += "\n<input type='text' name='field"+i+"'><br><br>"; } } </script> <select name="numTimes" id="numTimes" onchange="addFields(this.value)"> <option selected>Select Number <option value="1">1 <option value="2">2 <option value="3">3 </select> <br><br> <span id="more"> <!-- Dynamically Populated Input Fields Here --> </span> -
This is one way you can do this: <script language="javascript"> function changeMenuOptions(what) { var months = document.getElementById("selectMonth").value; if (months == "3" || months == "5" || months == "8" || months == "10") { document.getElementById("selectDay").innerHTML="<OPTION VALUE=\"1\" SELECTED>1</OPTION><OPTION VALUE=\"2\">2</OPTION><OPTION VALUE=\"3\">3</OPTION><OPTION VALUE=\"4\">4</OPTION><OPTION VALUE=\"5\">5</OPTION><OPTION VALUE=\"6\">6</OPTION><OPTION VALUE=\"7\">7</OPTION><OPTION VALUE=\"8\">8</OPTION><OPTION VALUE=\"9\">9</OPTION><OPTION VALUE=\"10\">10</OPTION><OPTION VALUE=\"11\" >11</OPTION><OPTION VALUE=\"12\">12</OPTION><OPTION VALUE=\"13\">13</OPTION><OPTION VALUE=\"14\">14</OPTION><OPTION VALUE=\"15\">15</OPTION><OPTION VALUE=\"16\">16</OPTION><OPTION VALUE=\"17\">17</OPTION><OPTION VALUE=\"18\">18</OPTION><OPTION VALUE=\"19\">19</OPTION><OPTION VALUE=\"20\">20</OPTION><OPTION VALUE=\"21\">21</OPTION><OPTION VALUE=\"22\">22</OPTION><OPTION VALUE=\"23\">23</OPTION><OPTION VALUE=\"24\">24</OPTION><OPTION VALUE=\"25\">25</OPTION><OPTION VALUE=\"26\">26</OPTION><OPTION VALUE=\"27\">27</OPTION><OPTION VALUE=\"28\">28</OPTION><OPTION VALUE=\"29\">29</OPTION><OPTION VALUE=\"30\">30</OPTION>"; } else if (months == "1") { document.getElementById("selectDay").innerHTML="<OPTION VALUE=\"1\" SELECTED>1</OPTION><OPTION VALUE=\"2\">2</OPTION><OPTION VALUE=\"3\">3</OPTION><OPTION VALUE=\"4\">4</OPTION><OPTION VALUE=\"5\">5</OPTION><OPTION VALUE=\"6\">6</OPTION><OPTION VALUE=\"7\">7</OPTION><OPTION VALUE=\"8\">8</OPTION><OPTION VALUE=\"9\">9</OPTION><OPTION VALUE=\"10\">10</OPTION><OPTION VALUE=\"11\" >11</OPTION><OPTION VALUE=\"12\">12</OPTION><OPTION VALUE=\"13\">13</OPTION><OPTION VALUE=\"14\">14</OPTION><OPTION VALUE=\"15\">15</OPTION><OPTION VALUE=\"16\">16</OPTION><OPTION VALUE=\"17\">17</OPTION><OPTION VALUE=\"18\">18</OPTION><OPTION VALUE=\"19\">19</OPTION><OPTION VALUE=\"20\">20</OPTION><OPTION VALUE=\"21\">21</OPTION><OPTION VALUE=\"22\">22</OPTION><OPTION VALUE=\"23\">23</OPTION><OPTION VALUE=\"24\">24</OPTION><OPTION VALUE=\"25\">25</OPTION><OPTION VALUE=\"26\">26</OPTION><OPTION VALUE=\"27\">27</OPTION><OPTION VALUE=\"28\">28</OPTION><OPTION VALUE=\"29\">29</OPTION>"; } else { document.getElementById("selectDay").innerHTML="<OPTION VALUE=\"1\" SELECTED>1</OPTION><OPTION VALUE=\"2\">2</OPTION><OPTION VALUE=\"3\">3</OPTION><OPTION VALUE=\"4\">4</OPTION><OPTION VALUE=\"5\">5</OPTION><OPTION VALUE=\"6\">6</OPTION><OPTION VALUE=\"7\">7</OPTION><OPTION VALUE=\"8\">8</OPTION><OPTION VALUE=\"9\">9</OPTION><OPTION VALUE=\"10\">10</OPTION><OPTION VALUE=\"11\" >11</OPTION><OPTION VALUE=\"12\">12</OPTION><OPTION VALUE=\"13\">13</OPTION><OPTION VALUE=\"14\">14</OPTION><OPTION VALUE=\"15\">15</OPTION><OPTION VALUE=\"16\">16</OPTION><OPTION VALUE=\"17\">17</OPTION><OPTION VALUE=\"18\">18</OPTION><OPTION VALUE=\"19\">19</OPTION><OPTION VALUE=\"20\">20</OPTION><OPTION VALUE=\"21\">21</OPTION><OPTION VALUE=\"22\">22</OPTION><OPTION VALUE=\"23\">23</OPTION><OPTION VALUE=\"24\">24</OPTION><OPTION VALUE=\"25\">25</OPTION><OPTION VALUE=\"26\">26</OPTION><OPTION VALUE=\"27\">27</OPTION><OPTION VALUE=\"28\">28</OPTION><OPTION VALUE=\"29\">29</OPTION><OPTION VALUE=\"30\">30</OPTION><OPTION VALUE=\"31\">31</OPTION>"; } } </script> <SELECT name='month' id='selectMonth' onchange='changeMenuOptions(this.value)'> <OPTION VALUE="0" SELECTED >January</OPTION> <OPTION VALUE="1">February</OPTION> <OPTION VALUE="2">March</OPTION> <OPTION VALUE="3">April</OPTION> <OPTION VALUE="4">May</OPTION> <OPTION VALUE="5">June</OPTION> <OPTION VALUE="6">July</OPTION> <OPTION VALUE="7">August</OPTION> <OPTION VALUE="8">September</OPTION> <OPTION VALUE="9">October</OPTION> <OPTION VALUE="10">November</OPTION> <OPTION VALUE="11">December</OPTION> </SELECT> <SELECT name='day' id='selectDay'> <OPTION VALUE="1" SELECTED>1</OPTION> <OPTION VALUE="2">2</OPTION> <OPTION VALUE="3">3</OPTION> <OPTION VALUE="4">4</OPTION> <OPTION VALUE="5">5</OPTION> <OPTION VALUE="6">6</OPTION> <OPTION VALUE="7">7</OPTION> <OPTION VALUE="8">8</OPTION> <OPTION VALUE="9">9</OPTION> <OPTION VALUE="10">10</OPTION> <OPTION VALUE="11" >11</OPTION> <OPTION VALUE="12">12</OPTION> <OPTION VALUE="13">13</OPTION> <OPTION VALUE="14">14</OPTION> <OPTION VALUE="15">15</OPTION> <OPTION VALUE="16">16</OPTION> <OPTION VALUE="17">17</OPTION> <OPTION VALUE="18">18</OPTION> <OPTION VALUE="19">19</OPTION> <OPTION VALUE="20">20</OPTION> <OPTION VALUE="21">21</OPTION> <OPTION VALUE="22">22</OPTION> <OPTION VALUE="23">23</OPTION> <OPTION VALUE="24">24</OPTION> <OPTION VALUE="25">25</OPTION> <OPTION VALUE="26">26</OPTION> <OPTION VALUE="27">27</OPTION> <OPTION VALUE="28">28</OPTION> <OPTION VALUE="29">29</OPTION> <OPTION VALUE="30">30</OPTION> <OPTION VALUE="31">31</OPTION> </SELECT> There is also other ways; like adding or removing options. If that is what you would rather do; Google It. You should be able to find plenty of example and tutorials on how to add/remove options from select menus.
-
<script language="javascript"> var month="January"; switch(month) { case "January": var month="01"; break; case "February": var month="02"; break; case "March": var month="03"; break; case "April": var month="04"; break; case "May": var month="05"; break; case "June": var month="06"; break; case "July": var month="07"; break; case "August": var month="08"; break; case "September": var month="09"; break; case "October": var month="10"; break; case "November": var month="11"; break; case "December": var month="12"; break; } alert(month); // remove this - demo purposes only </script>
-
[SOLVED] why dosen't the window pop up with custom dimensions?
phpQuestioner replied to A2xA's topic in Javascript Help
Is this what your wanting? The script is now set-up for your users/members to type just their id number in and the pop-up window will open up to that page, with their id number sent in a query string, to that page. <script language="javascript"> function popUp() { var id = document.getElementById('urlselection').value; window.open('http://wiicharged.com/index.php?action=hubs&id='+id+'','' + id + '','toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=275,height=300'); } </script> <form onsubmit="popUp(); return false"> <input type="text" id="urlselection"> <input type="button" value="Join the hub" onClick="popUp()"> </form> -
View the code; look for specific parts of the script that changes css styles. If you can correct and save the css style issue, that the external js cause, do so as needed. Otherwise, add inline css as needed to the html elements; too override js code.
-
You take the current textarea value; add paragraph tags to it and it all together back in the textarea. You can reference all links with the code I provided for you before; just change the attribute to href.
-
[SOLVED] why dosen't the window pop up with custom dimensions?
phpQuestioner replied to A2xA's topic in Javascript Help
You cannot put a url in document.getElementById; that is not the way it works. I missed that before; sorry about that. Use the original code I provided you; before you changed it. -
Not really sure what to tell you about this one; never created something quit like that. - Good Luck
-
[SOLVED] Is there a way to add attribute to an element?
phpQuestioner replied to optikalefx's topic in Javascript Help
Good Luck -
Your wanting a WYSIWYG Editor; search Google for "TinyMCE".
-
What? - That's All I Can Say Your going to have to explain what your wanting or what your having problems with or errors or something.
-
The best way to do this is server side with an explode().
-
[SOLVED] Best approach/practice for list/menu - ajax/update
phpQuestioner replied to yandoo's topic in Javascript Help
I would go with AJAX; that way, you page does not have to reload each time you query your database. -
[SOLVED] Best approach/practice for list/menu - ajax/update
phpQuestioner replied to yandoo's topic in Javascript Help
The only way to have database interaction with your javascript is to use ajax; unless you use php to post your database query for your first select menu; back to your second select menu.