Jump to content

ECHO to DIV

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
ductiletoaster

ductiletoaster

    Newbie

  • Members
  • PipPip
  • 15 posts
ok so im creating a contact form and validation page... i have it so that it can validate using both javascript and php. Now i want to be able to have it still validate even when javascript is disabled. my question is.... is there a way to echo, or print info to a specific div using php.

#2
Guest_Jaan_*

Guest_Jaan_*
  • Guests
<?php

function validateForm(){

    return $something;
    
}

$str = validateForm();

// find a div where you want to print it

echo "<div id='someDiv'>".$str."</div>";

?>

Something like that ?

#3
ductiletoaster

ductiletoaster

    Newbie

  • Members
  • PipPip
  • 15 posts
now that just echo's a div i wanted to know if u can send data to be displayed with in an already existing div

#4
Orjan

Orjan

    Writes binary right handed and hex left handed

  • Moderators
  • 3,299 posts
you can always change the content of an div with a javascript, and load the new content from the server with ajax calls.
__________________________________________
I study Information Systems at Karlstad University when I'm not on CodeCall