Wednesday, 14 May 2014
Tuesday, 6 May 2014
Bob Buzzard Blog: Reading Barcodes in Salesforce1
Bob Buzzard Blog: Reading Barcodes in Salesforce1: A little over a month ago I wrote a post on Reading QR Codes in Salesforce1 . At the time I added an entry to my todo list to investigate ba...
Monday, 5 May 2014
Handle ENTER event key press in visual force page
Handle ENTER event key press in visual force page OR
Preventing default form submission and calling an action instead
Preventing default form submission and calling an action instead
<apex:page standardController="account" >
<script type="text/javascript">
function submitListener(e){
var keynum = 0;
if (window.event){
keynum = window.event.keyCode;
}
else if (e.which){
keynum = e.which;
}
// Here we check whether the Enter button was pressed
if (keynum == 13){
onFormSubmit();
}
}
<script type="text/javascript">
function submitListener(e){
var keynum = 0;
if (window.event){
keynum = window.event.keyCode;
}
else if (e.which){
keynum = e.which;
}
// Here we check whether the Enter button was pressed
if (keynum == 13){
onFormSubmit();
}
}
</script>
<apex:form id="orderSearchForm" onkeyup="submitListener(event)">
<apex:actionFunction
name="onFormSubmit" action="{!save}"
/>
<apex:pageBlock title="View
AND Edit">
<apex:pageBlockButtons >
<!-- --> <apex:commandButton
action="{!cancel}" value="Cancel"/>
<apex:commandButton
action="{!save}" value=":-)" />
<apex:commandButton action="{!cancel}"
value="Cancel"/>
</apex:pageBlockButtons>
<apex:pageblockSection columns="2">
<apex:pageblockSection
columns="1">
Name: {!account.name}
</apex:pageblockSection>
<apex:pageblockSection
columns="1">
<apex:inputField value="{!account.name}" />
<apex:inputField value="{!account.type}" />
<apex:inputField value="{!account.industry}"/>
<apex:inputField value="{!account.fax}" />
</apex:pageblockSection>
</apex:pageblockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
Subscribe to:
Posts (Atom)