⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

"Add new item" option beside an Input field in Create form



r00tkiit
  • profile picture
  • Member

Posted 11 August 2012 - 08:13 AM

I want to modify the Create Form.

In my form, I have a column where there is a drop down list. Now, i want to add an option beside the drop-down list which says 'Add new item' for adding an item which isnt on the drop-down list. When someone clicks on that link, a new window should open which is another groceryCrud Create page(already designed). When the user submits that page, the window should close and the new item should reflect in the drop-down list now.

I hope i have conveyed my requirement properly.

Any kind of help is appreciated.

Thanks. Cheers.

r00tkiit
  • profile picture
  • Member

Posted 01 September 2012 - 10:16 AM

guys please reply

crina
  • profile picture
  • Member

Posted 03 October 2012 - 09:22 AM

you could use JS and delegate on the click event to open e popup ( I use lightbox ) in which you can load what you want, and on the success branch of the ajax, use JS to set the returned value in the input you want from the form ...

Hope it helps ! (I have done something like this for a send by email button from the list - the thing you want is pretty much similar)

r00tkiit
  • profile picture
  • Member

Posted 03 October 2012 - 14:16 PM

[quote name='crina' timestamp='1349256178' post='3745']
you could use JS and delegate on the click event to open e popup ( I use lightbox ) in which you can load what you want, and on the success branch of the ajax, use JS to set the returned value in the input you want from the form ...

Hope it helps ! (I have done something like this for a send by email button from the list - the thing you want is pretty much similar)
[/quote]

Thanks a lot for the reply.
Can you please share some sample code with me?

tofayelahmed
  • profile picture
  • Member

Posted 04 October 2012 - 04:48 AM

Hello r00tkiit .
Please follow the link./topic/364-answered-set-relation-and-add-new-button-to-quick-insert/#entry1458.
I think it will fullfill your requirements.
Thanks.