deansaddigh Posted May 12, 2010 Share Posted May 12, 2010 Hi guys, how can i concatenate this line class="validate['required'] text-input" into this echo '<input type="text" name="subject" value="'.$value.'" readonly/>'; Any help with i would be wicked Link to comment https://forums.phpfreaks.com/topic/201554-concatinate-issue/ Share on other sites More sharing options...
Pikachu2000 Posted May 12, 2010 Share Posted May 12, 2010 Not really sure what you're trying to accomplish, but do you mean something like this? If so, it seems pointless to have a readonly text field that has a "required" attribute. Just sayin' . . . EDIT: On second thought, what exactly are you trying to accomplish? echo '<input class="validate[\'required\'] text-input" type="text" name="subject" value="'.$value.'" readonly />'; Link to comment https://forums.phpfreaks.com/topic/201554-concatinate-issue/#findComment-1057429 Share on other sites More sharing options...
deansaddigh Posted May 12, 2010 Author Share Posted May 12, 2010 that required part is part of a script which valiadates the form , i need to have it in here like for these other ones <input type="text" name="surname" class="validate['required'] text-input" /> You can see it working here http://www.languageschoolsuk.com/course_enquiry.php if you leave a field blank some java script will pop up, but because the question and subject are coded in php i dont know how to add this line to it class="validate['required'] text-input" Link to comment https://forums.phpfreaks.com/topic/201554-concatinate-issue/#findComment-1057433 Share on other sites More sharing options...
Pikachu2000 Posted May 12, 2010 Share Posted May 12, 2010 OK, then the example I gave above should work for you, just drop the "readonly" attribute from it (since requiring input in a field, then denying the user the ability to supply it would cause the universe to implode) Link to comment https://forums.phpfreaks.com/topic/201554-concatinate-issue/#findComment-1057435 Share on other sites More sharing options...
deansaddigh Posted May 12, 2010 Author Share Posted May 12, 2010 thanks alot dude really appreciate the help all works now. Ps i gave you the wrong bit of code, that code i gave you was in a if statment that pre-populates that subject box if they have come from somewhere else. so the code was if( (isset($_GET['coursename']) ) && (isset($_GET['schoolname']) ) ) { $coursename =$_GET['coursename']; $schoolname =$_GET['schoolname']; $value = $schoolname."-".$coursename; echo '<input type="text" name="subject" value="'.$value.'" readonly/>'; } else { echo '<input type="text" class="validate[\'required\'] text-input" name="subject" />'; } I meant to give you the bit of code in the else statment , i hope that clears it up abit anyway. All works now so thanks Link to comment https://forums.phpfreaks.com/topic/201554-concatinate-issue/#findComment-1057436 Share on other sites More sharing options...
Pikachu2000 Posted May 12, 2010 Share Posted May 12, 2010 Ah, that makes much more sense. Glad I was able to help out. Link to comment https://forums.phpfreaks.com/topic/201554-concatinate-issue/#findComment-1057438 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.