Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a custom form added as a webpart that sends to another site. Unfortunately the name attributes of each of my fields is getting prepended with WPQ2 automatically.

for example:

<input type="hidden" name="farmer" />

gets changed to

<input type="hidden" name="WPQ2farmer" />

What is going on?

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

This is how SharePoint handles web parts and the possibility that there will be multiple versions of the same web part and therefore multiples of each element. This gets especially tricky because the ID prefix cannot be counted on to stay WPQ2. If you are looking to do things client side, then you will want to work with some other containers that can be better located or use more complicated selectors that can identify the object.

share|improve this answer
    
After reading more info about Form Web Part, I am apparently using it for the wrong reasons. I need to "embed" a form via the Page Viewer Web Part. Form Web Part is for internal use only... very specific. Thank you –  kylex Sep 16 '11 at 2:29
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.