Jump to content

form help


robcrozier

Recommended Posts

Can someone help!!!

im trying to check if a form field is empty, though its always showing as not empty as im echoing a php session variable in the value attribute if the variable is present. Heres the form field:

[code]
<input name="page_name_<? echo $i; ?>" type="text" class="style183" size="40" value="<? echo $page_name_[$i]; ?> ">
[/code]

its also being displayed in a loop.

Basically the problem is that having:

[code] value="<? echo $page_name_[$i]; ?> "
[/code]

at the end always displays a couple of blank spaces in the form, when the variable $page_name if not present, so the return value never shows as empty.

Any help appreciated!!!!
Link to comment
https://forums.phpfreaks.com/topic/26681-form-help/
Share on other sites

no mate the loops fine,

what i want to do is either echo the valie of $page_name in the textfield or echo nothing at all, depending on whether $page_name has a value. The problem occurs when $page_name does not have a value set. The echo statement in the value attribute of the textfield then prints a few zero's, which stops the returning value of the text field showing as empty. 

Hope this makes it a bit clearer, its hard to describe.
Link to comment
https://forums.phpfreaks.com/topic/26681-form-help/#findComment-122054
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.