robert_gsfame Posted November 25, 2009 Share Posted November 25, 2009 can i have let say "<a href="#">Check All</a>" and once clicked the word "Click here" change into "Uncheck All" and it will change back into Check All if i click "Uncheck All" Can anyone help this Link to comment https://forums.phpfreaks.com/topic/182866-change-words-once-clicked/ Share on other sites More sharing options...
Goldeneye Posted November 25, 2009 Share Posted November 25, 2009 This could potentially be a JavaScript request. BUT you can do this in PHP set a variable like $_GET['checkall']. This variable will equal either 1 (for true) or 0 (for false) if($_GET['checkall'] == 1) echo '<a href="?checkall=0">Uncheck All</a>'; else echo '<a href="?checkall=1">Check All</a>'; Link to comment https://forums.phpfreaks.com/topic/182866-change-words-once-clicked/#findComment-965231 Share on other sites More sharing options...
dropfaith Posted November 25, 2009 Share Posted November 25, 2009 <div onclick="changeText(this)">some text</div> then the js function changeText(currentElement){ currentElement.firstChild.data="new text"; } Link to comment https://forums.phpfreaks.com/topic/182866-change-words-once-clicked/#findComment-965233 Share on other sites More sharing options...
robert_gsfame Posted November 25, 2009 Author Share Posted November 25, 2009 if i use $_GET like what you said means that i redirect to the same page, i wish to have it without redirecting the page.. And yes javascript would be nice..anyway thanks for your input Link to comment https://forums.phpfreaks.com/topic/182866-change-words-once-clicked/#findComment-965235 Share on other sites More sharing options...
dropfaith Posted November 25, 2009 Share Posted November 25, 2009 yea without refreshing its a javascript issue i think my quick tag should do the trick tho Link to comment https://forums.phpfreaks.com/topic/182866-change-words-once-clicked/#findComment-965236 Share on other sites More sharing options...
robert_gsfame Posted November 25, 2009 Author Share Posted November 25, 2009 but dropfaith, i have tried the code it will only change the text once...when i click again, no changing occured Link to comment https://forums.phpfreaks.com/topic/182866-change-words-once-clicked/#findComment-965238 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.