You need to sign in to do that
Don't have an account?

html input tag to direct to a field in custom object
Hi,
I am using an html input tag. How do i direct it to a particular field in custom object?
Example: if I say input tag to be name and I want to store it in a field called FirstName which is in custom Object: "info" then how would I do it?
<apex:outputLabel value="name" for= "name"/>
<input type="text" id="fName" value = "{!sth that the user will input}" />
Thanks Much!
Justin~sfdc
You need to use either apex:inputField, or to override the type of the field, you can use apex:inputText, apex:inputCheckbox, apex:selectList, etc. Check out the Visualforce developer's guide or the Component reference.
Thanks for the response. Actually i'm using al these under an apex: repeat function. The given input functionality gets repeated depending upon number of users so, everytime it is repeated, i wanna give it a separate id. And as we cannot do this in
inputfield="" id="country{!x}" value="{!address.country__c}">
this is why i had to use html input tag jnstead of vf component and am unaware of how to direct it to that particular field in the object
Thanks,
Justin~sfdc
You are correct as well, "the repeat tag will each time add a number" but
it only does it in this way: Lets say if the id= country and repeat block
repeats the same function 3 times then we get the id;s in this way=>
repeatblock0:country, repeatblock1:country, repeatblock2:country.
But I wanted the id as Country1, country2, country3. and I am able to
achieve this functionality using , and input html tag.
--
Thanks,
justin~sfdc
If you don't bind to an apex:* attribute, you will have to accept the consequences. Mostly, this means that you'll need action functions to update the view state using JavaScript before any other action is executed. I believe that the most profound effect is that this may reduce the page's responsiveness. I'm hesitant to actually write a demonstration for this, because the exact structure that one might need depends on the mixture of HTML and Visualforce, etc. Generically, though, it might look like this:
This code is simplified, but illustrates the potential annoyances you'll have to go through. You'll also have to address the loss of focus, adding/removing rows (possibly), and so on. Each extra feature will become increasingly costly to implement compared to native Visualforce.
Of course, the alternative would be to have the entire form be hidden and the remainder of the page rendered by JavaScript. This would give you more control over the focus of the page, but would make the page even more complex to manage.