Is it possible to choose which channel a safecracker form should post to if you leave the safecracker's channel to ="" and then having a radio selection of the channel_id's??

is this even possible?


You can do this with jQuery. The channels will all need to use the same field group.

When you add the channel parameter channel="" to your exp:safecracker tag, the tag renders that in the template as a hidden field with that channel's id number as the value. For example:

  <input type="hidden" name="channel_id" value="7" />

You can change this value as needed with JS. I created a jsFiddle with working code that will get you started.

  • I'm getting errors thrown before I can even add the channel dynamically through JS. Should I start with a default channel first? Jan 18 '13 at 4:25
  • Yes add a default channel
    – Anna_MediaGirl
    Jan 18 '13 at 4:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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