Jump to content

concatinate issue


deansaddigh

Recommended Posts

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

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.