<apex:page id="Page" standardController="Account" extensions="vidsav" sidebar="false">
<script src="/soap/ajax/20.0/connection.js" type="text/javascript"></script>
<script>
function dup() {
alert("test");
sforce.connection.sessionId = "{!$Api.Session_ID}";
var res = document.getElementById("Page:form:PB:sd:PBS:Name").value;
alert(res);
var qr = sforce.connection.query("select id, Name From Account WHERE name = '" + res + "'");
alert(qr);
if (qr.size != 0) {
if (confirm('Are you sure?')) {
alert('testdup');
}
return false;
}
}
</script>
<apex:form id="form">
<apex:pageBlock id="PB" >
<apex:pageBlockTable value="{!sc}" var="que" id="sd">
<apex:column value="{!que.id}"/>
<apex:column value="{!que.Name}" id="PBS"/>
<apex:column value="{!que.Industry}"/>
<apex:column >
<apex:commandLink action="{!deleteStudent}" onclick="if(!confirm('Are you sure?')) return false;" value="Del">
<apex:param value="{!que.Id}" name="idToDel" assignTo="{!SelectedStudentId}"/>
</apex:commandLink>
<apex:commandButton value="AddProcess" onclick="dup()" rerender="all"/ ></apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
<apex:inputText value="{!searchstring}" label="Input"/>
<apex:commandButton value="Search records" action="{!search}"/>
<apex:commandButton value="Clear records" action="{!clear}"/>
</apex:form>
</apex:page>
как получить значение столбца вершины в javascript? Это всегда ничего не возвращает в res var res = document.getElementById("Page:form:PB:PBS:Name").value; оповещение(рез);
Как передать параметр функции действия из формы javascript для вызова метода вершины
Мы изменили для pageblocktable также мы определили идентификатор после этого также не получая значение
var res = document.getElementById("Page:form:PB:sd:PBS:Name").value ;