How to add custom link just right after input field in add/edit pop up form?

QuestionsHow to add custom link just right after input field in add/edit pop up form?
Rankaj asked 9 years ago

How to add custom link just after input field in add/edit pop up form?

e.g: Add more link onclick of which a new pop up grid window will open like below:-

Country Name: [Input Field Here] <Add More Link>
City Name : [Input Field Here] <Add More Link>

3 Answers
Abu Ghufran answered 9 years ago

Hello,

You can connect afterShowForm event and put your link using jquery append.
Column name is set as id of input.

$grid["add_options"]["afterShowForm"] = 'function(formid) { jQuery("#country").append('my link'); }';
$g->set_options($grid);

Rankaj answered 9 years ago

Dear Abu,

I have added like that below:-

Below not working fine for <anchor> tag:-
—————————————-
$grid["add_options"]["afterShowForm"] = 'function(formid){jQuery("#url").after("<a href="#">Add</a>")}';

But its showing syntax error of [SyntaxError: illegal character]

Below is working fine for <span> tag:-
————————————–

$grid["add_options"]["afterShowForm"] = 'function(formid){jQuery("#url").after("<span>Add New</span>")}'

Abu Ghufran answered 9 years ago

you are using double quote inside double quote … "<a href="#">Add</a>"
Try: "<a href='#'>Add</a>"

Your Answer

7 + 9 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?