function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
vandana rajuvandana raju 

rendering visualforce page in html5

Hi
I have a visualforce with standard controller=account and doctype=HTML 5.0. when I enter acocunt Name and click save button it is not saving to object. please let me know if any issue.
 
<apex:page docType="HTML-5.0" 
           standardController="Account"
           standardStylesheets="false"
           showheader="false"
           sidebar="false">
 <html>
<head>   
</head>
<body>
<form>
<table>
<tr>
<td>
Account Name:
</td>
<td>
<Input type="Text"/> 
</td>
</tr>

</table>
</form>
</body>
</html>
<apex:form >
<apex:commandButton action="{!Save}"
                    value="Save" />
                   
</apex:form>     
</apex:page>

Thanks
Pooja Hegde
Best Answer chosen by vandana raju
Karan Shekhar KaulKaran Shekhar Kaul
Try this 

<apex:page standardController="Account" standardStylesheets="false" docType="html-5.0">

<apex:form>
<table>
<tr>
Please enter account Name
<td>
</td>
<td>
<apex:inputField value="{!Account.Name}"/>  
</td>
</tr>
</table>



<apex:commandButton action="{!Save}" value="Save" />           
</apex:form>     
</apex:page>

All Answers

Karan Shekhar KaulKaran Shekhar Kaul
Hi Pooja,

You have not bind account name input field on page. try below code.<apex:command> button will execute statndard Save method if it finds apex:inputfield tied to standard controller's field.

<apex:page docType="HTML-5.0" 
           standardController="Account"
           standardStylesheets="false"
           showheader="false"
           sidebar="false">
 <html>
<head>   
</head>
<body>
<form>
<table>
<tr>
<td>
Account Name:
</td>
<td>
<apex:inputfield value="{!account.name}"/>
</td>
</tr>

</table>
</form>
</body>
</html>
<apex:form >
<apex:commandButton action="{!Save}"
                    value="Save" />
                   
</apex:form>     
</apex:page>
vandana rajuvandana raju
Hi Karan

I placed the <apex:InputField> inside the <td> tag. But I am getting the error as : Error: <apex:inputField> (under <apex:page>) must occur between <apex:form></apex:form> tags.
<apex:page docType="HTML-5.0" 
           standardController="Account"
           standardStylesheets="false"
           showheader="false"
           sidebar="false">
      
 <html>
<head>   
</head>
<body>

<table>
<tr>
Please enter account Name
<td>
</td>
<td>
<apex:inputField value="{!Account.Name}"/>  
</td>
</tr>
</table>

</body>
</html>

<apex:form>


<apex:commandButton action="{!Save}"
                    value="Save" />
                   
</apex:form>     
</apex:page>
Please let me know

thanks
vandana

 
Karan Shekhar KaulKaran Shekhar Kaul
Try this 

<apex:page standardController="Account" standardStylesheets="false" docType="html-5.0">

<apex:form>
<table>
<tr>
Please enter account Name
<td>
</td>
<td>
<apex:inputField value="{!Account.Name}"/>  
</td>
</tr>
</table>



<apex:commandButton action="{!Save}" value="Save" />           
</apex:form>     
</apex:page>
This was selected as the best answer
vandana rajuvandana raju
Hi karan
its working.
thanks