-
Posts
289 -
Joined
-
Last visited
Posts posted by adam84
-
-
awesome, the only thing is that i have version 4.44 and this is version 5. Any other way..?
-
I have a textfield where the user enters a keyword about whatever they are looking for. I send the data to my php file to be processed and what I want to do is highlight the keyword that the user entered in, when I display the all the results that have matched the keyword.
What I did was use the str_replace() function, but what I have noticed is the function is case sensitive. So if the user enters 'beer'. Only the word 'beer' will get highlighted, but 'Beer', 'beeR' or 'BEER'. What would I need to do, to make it work on every instance of the word.
-
I've had the same problem, but I keep on messing around with it and eventually it works in IE
-
I am not 100% sure on this, but when the user clicks the submit, it might be a little easier to use javascript to close all the opened windows under the parent window(main window) and just reopen a new window with the new data.
-
couldnt you use the
<INPUT TYPE=FILE ID=file1> ???
or did you want something different from that
-
1. you can use ajax to load the details or note pages into the div/span tag.
2. use a form, so that when the user clicks a tab, the page refreshes and you can then see which variable isset and load the corresponding page into the div/span tag
-
instead of displaying:
echo '<p><b>Success!</b></p>'; echo '<span>Your registration was successfully processed. You may login and start using your account. Thank you for registering !</span>';
use redirect("Location: members.php");
-
when did you want to call the ajax function?
- Whenever the using types something in?
- After the object loses its focus(blur)?
- or any other way I cannot think of at the moment?
-
Straight forward Ajax
- every other ajax call works fine
function sendRequest(act,divtag) { http.open('get', act); http.onreadystatechange = openRequest; divhandler.divtag = divtag; http.send(null); } function sendLog(act,divtag) { http.open('get', act); http.onreadystatechange = openLog; divhandler.divtag = divtag; http.send(null); }
Function where the error occurs in
function submitReview( pID, back, fromGoto ){ var errors = ''; var concat = ''; // I deleted the data validation checks if( errors != '' ) document.getElementById('reviewErrorID').innerHTML = '<FONT COLOR=red>' + errors + '</FONT>'; else{ document.getElementById('reviewErrorID').innerHTML = ''; var div = 'searchDIV'; if(fromGoto>0) div = 'contentDIV'; var str = 'insertReview.php?'; str += 'pID='+pID; str += '&title='+encodeURIComponent(title); str += '&gender='+gender; str += '&weight='+weight; str += '&height='+height; str += '&bf='+bf; str += '&pros='+encodeURIComponent(pros); str += '&cons='+encodeURIComponent(cons); str += '&supps='+supps; str += '&back='+back; str += '&fromGoto='+fromGoto; sendRequest(str,div); } }
The pros/cons variables can hold upto 1000 characters.
This function works fine if:
- I comment out the sendRequest(str,div); line
- both pros/cons have under 400 characters
This function gets an error if:
- both pros/cons have over 400 characters
The error I get when I submit the page is 'The system cannot locate the resource specifed'.
-
???
-
Straight forward Ajax
- every other ajax call works fine
function sendRequest(act,divtag) { http.open('get', act); http.onreadystatechange = openRequest; divhandler.divtag = divtag; http.send(null); } function sendLog(act,divtag) { http.open('get', act); http.onreadystatechange = openLog; divhandler.divtag = divtag; http.send(null); }
Function where the error occurs in
function submitReview( pID, back, fromGoto ){ var errors = ''; var concat = ''; // I deleted the data validation checks if( errors != '' ) document.getElementById('reviewErrorID').innerHTML = '<FONT COLOR=red>' + errors + '</FONT>'; else{ document.getElementById('reviewErrorID').innerHTML = ''; var div = 'searchDIV'; if(fromGoto>0) div = 'contentDIV'; var str = 'insertReview.php?'; str += 'pID='+pID; str += '&title='+encodeURIComponent(title); str += '&gender='+gender; str += '&weight='+weight; str += '&height='+height; str += '&bf='+bf; str += '&pros='+encodeURIComponent(pros); str += '&cons='+encodeURIComponent(cons); str += '&supps='+supps; str += '&back='+back; str += '&fromGoto='+fromGoto; sendRequest(str,div); } }
The pros/cons variables can hold upto 1000 characters.
This function works fine if:
- I comment out the sendRequest(str,div); line
- both pros/cons have under 400 characters
This function gets an error if:
- both pros/cons have over 400 characters
The error I get when I submit the page is 'The system cannot locate the resource specifed'.
-
use javascript( setInterval() ) to call the ajax function every 5 or whatever seconds
-
Ajax consists of two javascript functions. Ajax is javascript. So if you did put your ajax in an external JS file, it will be loaded by the user retrieving the page.
-
I am pretty sure that an Iframe will only load a page. So the only info you can get back would be the current src that the iFrame is currently pointing to. I could also be a big fat liar
-
1. try this to check if your radio button is selected
var r = document.getElementById("AnimationChoice");
var counter;
for (counter = 0; counter < r.options.length; counter++) {
if (r.options[counter].selected ) {
alert(r.options[counter].value);
break;
}
}
2. Something I found by putting id instead of name, it solved the problem. No 100% sure, try it
<td><input type=radio id="AnimationChoice" checked value="u0001">u0001</td>
<td><input type=radio id="AnimationChoice" checked value="u0002">u0002</td>
<td><input type=radio id="AnimationChoice" checked value="u0015">u0015</td>
-
i keep getting this error: 'The system cannot locate the resource specifed'. Everything i tried to submit my data. any ideas to prevent this or to solve it???
-
I have a page where the user can fill out information and there are two textareas where the user can enter up to 1000 characters in each textarea. If i put in a message about 200 characters long for each, everything works good. But if i enter 1000 characters in each textarea, i keep getting the same javascript error: 'The system cannot locate the resource specifed'. Do anyone know whats up with that???
-
Ya man, I count 5 open brackets '{' and 6 close brackets '}'
-
Probably the only way of doing this is using the Javascript to run a function every 1sec, then have the JS function use ajax to call a php file which you can check to see if there is any new update. Then load whatever you found into a div or span tag on your page.
JS file
function checkMessages(){ sendRequest('checkNewMessages.php','newMessages'); setTimeout("checkMessages", 1000); // Param 1 = "checkMessages" will call this function // Param 2 = 1000 milli = 1 sec }
PHP FILE
do whatever you need to do
-
Still no like. This is what is going in:
Used PHP to write JS
echo "Function validate(){" //i took out all the validation tests and stuff echo "sendRequest( encodeURI('insertTitle.php?title='+title), 'result' );"; echo "}"
I enter the text '100% Me? & You' and submit it
the url being passed is: insertTitle.php?title=100%25%20Me?%20&20You
my php file to process the data
<? $title = $_GET['title']; echo urldecode($title); ?>
result of this is: 100% Me?
-
if i use the encodeURIComponent() function, will i have to do anything special with php to decode the data?
-
I was wondering if it will cause a problem if the user enters some text like:
'I got 100% on my test & 85% on my assignment. What did you get?'
would the %, ? and & signs cause a problem with the data being sent? Is that a function that I should use to get around this...?
Thanks
-
I am using ajax, so I am manipulate the text with either php(prefer) or javascript.
I have a text area where the user enters whatever. They click send and a 'js' function gets called and it calls my sendRequest function and sends over the data to my php file to be insert into my db.
What I want to do is remove any of the html/js tags I can. The only thing I want to keep is the spacing the user enters (line spacing).
My php file - I have tried many different ways, but none of them seem to work
$txt = $_GET['text']; $stuff = array("\n","\r"); $txt = str_replace($stuff, "<br />"); echo strip_tags($txt, '<br />');
So using the code above if I enter:
<b>Test</b> This is a test
The Results is:
TestThis is a test
I've tried another method using 'preg_match', but i am getting an error b/c of the function.
by the way i am using php 4.4.4
Any ideas what is going on???
-
I dont know if this would be a php,html or mysql question, so i tried here furst. I have a textarea where the user enters whatever. Once the user is done, he/she clicks the send button and through ajax the textarea value gets sent to the php file to be process.
The problem is:
Say the user enters this in the textarea
Hello World!
This is a test!
I insert that value into my db. But when I retrieve the value the carriage return is not there.
I looks like this:
Hello World!This is a test!
What is the problem
DB Cross-Referencing
in MySQL Help
Posted
I have two Databases(user, products),
1: users(userID, userName) - deals with all the user stuff
2: productInformation (purchaseID, productID, userID )- deals with products and customer purchases
What I am trying to do is organize all the products by userName.
This is what I have:
But this doesnt work? any ideas?