shadiadiph Posted April 25, 2010 Share Posted April 25, 2010 How can i change the css style once a form has been posted using ajax and an error has been retrieved? Link to comment https://forums.phpfreaks.com/topic/199686-changing-css-styles-with-ajax/ Share on other sites More sharing options...
F1Fan Posted April 25, 2010 Share Posted April 25, 2010 If you eval() your AJAX response, your AJAX could print out JavaScript code that would change either the CSS class or specific CSS attributes. A couple examples: document.getElementById('elementId').className = 'newClassName'; document.getElementById('elementId').style.color = '#FF0000'; Link to comment https://forums.phpfreaks.com/topic/199686-changing-css-styles-with-ajax/#findComment-1048060 Share on other sites More sharing options...
shadiadiph Posted April 25, 2010 Author Share Posted April 25, 2010 thanks F1fan seems to be working I will ask again shortly if it doesnt work out sorry but i am useless at javascript Link to comment https://forums.phpfreaks.com/topic/199686-changing-css-styles-with-ajax/#findComment-1048063 Share on other sites More sharing options...
shadiadiph Posted April 25, 2010 Author Share Posted April 25, 2010 thanks F1fan that seemed to solve the problem but now i have another one which i believe means i will have to start a new post. Link to comment https://forums.phpfreaks.com/topic/199686-changing-css-styles-with-ajax/#findComment-1048069 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.