Jump to content

robert_gsfame

Members
  • Posts

    876
  • Joined

  • Last visited

Everything posted by robert_gsfame

  1. how can i go back to the first index of a combobox after alert("Please choose at least one checkbox") it's like focus() in textbox.. thx in advance!
  2. I pass the value from php code into javascript function and i have <textarea> where i put inside innerHTML, but i have this <br /> always attached when new line created although i have decode the value using unescape() how can i erase the <br />
  3. what if i want to check if string contain a-z or A-Z??
  4. i want to validate text where user has to input at least one letter if in php we have if(!ereg('[a-z]',string)){echo "wrong input";} how bout in Javascript?
  5. finally!!! var test=unescape(str.replace(/\+/g, " "));
  6. i use replace , unescape, decodeURI everything cannot replace the + with space
  7. not working..... the plus + sign is still there replacing the " "
  8. i have this in my html code onclick="test('$test1')" just let say $test1 ==>simple media@#$%^& has been encoded using urlencode so that i will have this Simple+Media%40%21%24%25%5E%26%2A% function test(x){ var test=unescape(x) alert('test') } using unescape will still leave the + sign, and when i use replace to change the sign with space, how come i still find the + sign???
  9. I have created a function in which the value has been encoded, how can i decode the value? unescape???or there is another way
  10. this is weird...when i keep on modifying the code for (var x = 1; x <= 6; x++) { document.getElementById(x).style.backgroundColor="#CCCCCC" } and it works! what is the different between this and what i've posted before????????gossh can anyone explain this to me is the 0 cause everything??
  11. no error.. they just won't work i cut the function into this function bgcol(){ for(i=0;i<5;i++){ document.getElementById(i).style.backgroundColor="#CCCCCC";} } and i use (i) as <td id> but no effect appear
  12. yes but not working..i think there's something wrong with the style.background How does the loop not working, even if i try to put the alert before the document.getElementById() inside the looping, but it stops after executing once (0) Really confused :'( :'(
  13. $query=mysql_query("SELECT * FROM table1 WHERE username='username'"); $total=mysql_num_rows($query); if(!empty($rows)){ while($array=mysql_fetch_array($query)){ $id=$array['id']; echo "<td id=$id onclick=changecolor('$id','$total');>";}} function changecolor(x,y){ document.getElementById(x).style.backgroundColor="#CCCCCC"; for(i=0;i<y+1;i++){ if(i!==x){ document.getElementById(i).style.backgroundColor="#FFFFFF";} } } So i wish to have td background change into #CCCCCC once click and have the other td background with #FFFFFF
  14. how bout js as i am not to familiar with jquery
  15. I have scrollbar to show all records that i retrieved from database...i wish to have <td> background color change to #CCCCCC once being click and let say i have 5 records, then if second record is being clicked then the background turn into #CCCCCC and when another record is being clicked assume third record then i want to have the third record background turn into #CCCCCC while the other turn into #FFFFFF i have this for my html, $id--> is the dynamic record, $total--> mysql_num_rows($query) <td id=$id onclick=changecolor('$id','$total')> then i have this function function changecolor(x,y){ document.getElementById(x).style.backgroundColor="#CCCCCC"; for(i=0;i<y+1;i++){ if(i!==x){ document.getElementById(i).style.backgroundColor="#FFFFFF";} } } Result: when i click on the record, it turn into #CCCCCC but when i click on the other record i still find the first record i choose before still with #CCCCCC background color not #FFFFFF thx in advance
  16. okay instead of using innerHTML, i prefer to use .style.display="none" as it will give me the result i expect
  17. i have this javascript function function cleartable(){ document.getElementById('tbl').innerHTML=""; } and html code: <table id="tbl"><tr><td>test</td></tr><tr><td><input type="button" value="clear" onclick="clearall()"></td></tr></table> when i click on the button, i wish to erase all table..i've tried in both browsers FF and IE..but i dont get what i expect when using IE...table is still there but in FF it works
  18. I have jquery to create a scrollbar at certain height <script> $(document).ready(function(){ $("div.scroll").scrollTop(300); }); </script> what i want to ask, can i resize the height of the scrollbar using cursor like what phpfreaks forum have for their textarea thx
  19. i try using FULLTEXT but i get the error when count the record using mysql_num_rows so instead of using it, i use REGEXP and it works
  20. i have let say table1 with this kind of record "James, King, Ronald, Steve" inside the column created and i want to check whether what user want is there...therefore i use this query $check=mysql_query(sprintf("SELECT * FROM table1 WHERE column LIKE '%%{$userinput}%%'", mysql_real_escape_string($userinput))); $numrows=mysql_num_rows($check); if(empty($numrows)){ echo "no result";}else{ echo "yes it's there";} when i put cheryl and start searching it then i will have the correct answer which is "no result"....but when i put only one letter "a" then i'll get "yes it's there" I wish to have "yes it's there" output only when user type James, or King or Ronald or Steve how can i do that? thx
  21. this what i found onmouseover="this.style.border='12px solid #CCCCCC;'"
  22. i have this code attached but no effect appeared when mouseover it echo "<tr class='style1' onmouseover=this.style.border='12px solid #CCCCCC;'> anything wrong with the code?? thx
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.