php7Q
-
Posts
17 -
Joined
-
Last visited
Never
Posts posted by php7Q
-
-
I would go with phpQ6's example; seems like a better choice, then bronzemonkey's idea.
-
<script language="javascript"> function doStuff(DIVID) { document.getElementById(DIVID).style.display="block"; } </script> <div id="myDIV"> Content Here </div> <img src="whatever.jpg" onclick="doStuff('myDIV')">
-
No Problem
-
You see where the function is being triggered; with the onchange() event, in the input text field? All you need to do is remove the onchange event from the input text field and add the "ajaxFunction()" to a button (that has an onclick event).
Example:
<input type="button" onclick="ajaxFunction()" value="Submit">
-
Check out this tutorial; it should get you on the right track:
http://www.tizag.com/ajaxTutorial/ajaxform.php
- Good Luck
-
Yeah, Your Probably Right - Don't Let It Drive You Mad In The Process - LOL
Coding Can Become An Addiction - LOL
-
Yeah man, I know what you mean. That's how I learned allot of stuff - "Googled It". Bought a book or two and hung-out on forums; kind of like this one (lol). Guess that is the price we pay to play the game.
-
Nice One Tom - Good Job - LOL
-
Or you could go with LemonInflux's example.
-
You would then do a little something like this:
<script language="javascript"> function valsub() { var field = document.getElementById('msg').value; var field2 = document.getElementById('msg2').value; var field3 = document.getElementById('msg3').value; if (field.length == 0 || field == null && field == "") { document.getElementById('btn').disabled = true; } else if (field2.length == 0 || field2 == null && field2 == "") { document.getElementById('btn').disabled = true; } else if (field3.length == 0 || field3 == null && field3 == "") { document.getElementById('btn').disabled = true; } else { document.getElementById('btn').disabled = false; } } </script> <form action="test.php"> <input id="msg" name="message" type="text" onkeyup="valsub()" /> <input id="msg2" name="message2" type="text" onkeyup="valsub()" /> <input id="msg3" name="message3" type="text" onkeyup="valsub()" /> <input id="btn" type="submit" name="Submit" value="Submit" disabled /> </form>
I mean, there are other ways to go about do that; but using my original example above - you would do something like this.
-
-
I assume your doing this with AJAX or that jQuery is doing this with AJAX. I would set the pagination up where it would display some where else; instead of in your "main" div. Otherwise you will have to create another AJAX function for the pagination too load the php page back into your div; instead of reloading the page. Even if your pagination is outside your "main" div; your probably going to need to have a AJAX function for your pagination anyway (that's my guess).
-
But I cannot spell either
few = view
-
I don't know; the moderators of this forum aren't to bright (but I have a personal beef with them - so others may few that differently)!
But I am glad I could help you out.
-
Here you go Tom; try this out and see how it works out for you.
<script language="javascript"> function valsub() { var field = document.getElementById('msg').value; if (field.length >= 1 && field != null && field != "") { document.getElementById('btn').disabled = false; } else { document.getElementById('btn').disabled = true; } } </script> <form action="test.php"> <input id="msg" name="message" type="text" onkeyup="valsub()" /> <input id="btn" type="submit" name="Submit" value="Submit" disabled /> </form>
Make submit clickable when form is filled?
in Javascript Help
Posted
I would need to know what you wanted it to do; so I can give you the right advice about that.