PDA

View Full Version : problem with custom PM page


squishi
08-01-2008, 07:52 AM
I have created a special page that shows the recipient, title and message input fields to send a new PM.
It works great.

Now I want the user not to be able to change the title and recipient field.

So I added the red code to the forms:

<input type="text" id="pmrecips_txt" name="recipients" size="25" tabindex="1" value="Admin" disabled />

and
<input type="text" class="bginput" name="title" value="PM TITLE" size="30" maxlength="85" tabindex="1" disabled />


Looks just like I want it to be. But when I now click on the send button, vbulletin tells me that the title and message body was not correctly filled out.
Please complete both the subject and message fields.

When I remove the "disabled"s, the sending of the PM works again.

How do I get this to work? Why is it not working in the first place?

--------------- Added 1217580997 at 1217580997 ---------------

Okay. I managed to get this to work by adding two hidden fields and by turning the visible form fields into "fake" ones.

I am still interested why this was not working, though.

h_jinx
08-01-2008, 10:46 AM
Use hidden variables


<input type="hidden" name="title" value="PM TITLE" />

Opserty
08-01-2008, 01:08 PM
Use hidden variables


<input type="hidden" name="title" value="PM TITLE" />

Read the post, that is exactly what the OP said they did... :)

On topic: I can't personally see why it would stop working, did you try the xHTML syntax for disabled?

<input... disabled="disabled" />

RLShare
08-01-2008, 05:31 PM
^ The newthread forms work the same way in VB, if you disable the subject/message field you cannot sumbit the form even if a value is set.

nexialys
08-01-2008, 05:41 PM
actually, the XHTML form for an disabled input will also disable its activation... so it's just for display, not in posting...

what you can do then is to have an hidden input after the disabled field, with the same values... like h_jinx have suggested... it will then submit when posting...

and xhtml talking is disabled="disabled", like Opserty suggested