How can i add textbox in site information - drupal

Alter the following form.
admin/config/system/site-information
Add a textbox in the site details section, below the email address textfield. The name of the textbox should be site_organisation.
Save the value entered in this textbox in a variable when the save configuration button is clicked.
The saved value should be displayed when the page is reloaded.
How can i do that? which module used for that?

Those are forms so you could use hook_form_alter to alter those forms:
https://api.drupal.org/api/drupal/modules!system!system.api.php/function/hook_form_alter/7
Also, check out this article:
https://www.drupal.org/node/1988004

Related

Marketo Forms2: How to track source

I can track the source of a lead doing go.example.com/?src='ThisSite' . What I don't know is how to track a form2 that was embedded and I don't find any information. Does anybody know how to do that? thanks!
To accomplish this, you will need to create a hidden field in your form that is auto-populated with the value of the referring page. Here's how to do this in Marketo:
Log in to Marketo
Under Marketing Activities, select your form and click Edit Form
Create a new field
Change the field type for the field you created to hidden
Select the option for Autofill
After the clicking option for Autofill, set Get Value From to Referrer Parameter.
Enter the Parameter Name which you want to get from the referrer URL and click SAVE.
Click Finish
Click Approve and Close

Access selected value from disabled dropdownlist

when I am disable dropdownlist using js, and then I access from .cs page.
It gives o value even there is one item is selected..
I want to disable dropdownlist but at the same I want to access its selected value as well
You cant access the disabled items from Code behind.
Disabled form values will not be sent in post data.
Check this post
Disabled form fields not submitting data
If you need add some css techniques like opacity and do.
Try to add selected value of dropdown in hidden field, and access value from hidden field.

ASP.NET - RequiredFieldValidator to validate only particular controls

I have a web form. There are many different sections. I can say that each section displays data of a datatable. At each section I have OK and Cancel buttons. When I press OK any changes to the table in the database takes place. I've also put some Requiredfieldvalidators. Let's say I'm inserting a new record in the section one and the fields are correctly typed. When I press OK I get error message raised by the rest of the validators that are on the other sections. Isn't there any way that when I press OK button of a particular section to get validation errors of that same area? So what I probably need is a button that will not serve as the hole page submitter but rather a submitter of a specific section.
Place a ValidationGroup on the RequiredFieldValidator's. Then place the same ValidationGroup on the correct submit button. When its clicked, only validation controls that are a part of the group are validated.
http://msdn.microsoft.com/en-us/library/ms227424.aspx
I think janhartmann is correct ValidationGroup can help you solve the issue.Have a look at this article

textbox - KeyPress event on Asp.net [no javascript]

I'm designing a website and I want my login page to catch "Enter" with all components, but i can not assign any Key or Mouse Events to TextBox ... After pressing to "Enter" a function should be run with 2 parameters (user name and password).
How can i do this?
If you wrap all the controls inside a standard HTML form then hitting enter in one of the text boxes will submit the form. You can then process the username and password entered on the server as with a normal form submission. Is that the behaviour you're looking for?
You don't need to trap any events on the client in this case so no need for JavaScript.
How to submit ASP.NET forms with the enter key
Read up on the defaultbutton property for forms and panels. This should get you what you want. From the site above:
ASP.NET 2.0 introduces a wonderful work around for this. By simply specifying the "defaultbutton" property to the ID of the , whose event you want to fire, your job is done.
The defaultbutton property can be specified at the Form level in the form tag as well as at panel level in the definition tag. The form level setting is overridden when specified at the panel level, for those controls that are inside the panel.
http://www.beansoftware.com/asp.net-tutorials/accept-enter-key.aspx
finally if found the answer. Here is ! The only problem is, I can not hide my button,
so that i put that button to web page as "Login" ... Defaultbutton could be hidden or not?

Adding a textbox dynamically

In my aspx page,when a user clicks on a Location "LinkButton", a new textbox should be dynamically added in the page.User can add a maximum of 10 textboxes.
Also, user can navigate to another page B from this page A.When he comes back to page A, all his textboxes should be persisted.
How do I achieve this functionality?
Thanks.
I would create a user control with a place holder object in it and then write something like:
if(NumberOfTextBoxes <= 10)
{
TextBox tb = new TextBox();
Placeholder1.Controls.Add(tb);
NumberOfTextBoxes++;
}
For reference I would recommend:
How to: Add Controls to an ASP.NET
Web Page Programmatically
PlaceHolder Class (The remarks section has a lot of HowTo's like the one above)
You need to keep information in the user's session about how many text boxes to show (and possibly their content). In the page's Init (?) handler you will need to add the text boxes each time.

Resources