BUG 7292 se soluciono problema de alert en campos suggest.

This commit is contained in:
Alvaro Campos
2012-01-18 10:21:50 -04:00
parent 42f12949c4
commit b94cede0ed
4 changed files with 41 additions and 13 deletions

View File

@@ -1357,6 +1357,42 @@ function dynaformSetFocus(){
return false;
}
/**
* Set id from id_label if it does not exist
*
* @Author alvaro <alvaro@colosa.com, alvaro.cs@live.com>
* @return false
*/
function idSet(name){
var inputs = document.getElementsByTagName('input');
if(inputs.length > 0){
for(i in inputs){
id = inputs[i].id;
if(id == "form["+name+"_label]"){
if(inputs[i].value.trim())
var valueLabel = inputs[i].value;
else
var valueLabel = "Empty";
}
if(id == "form["+name+"]"){
try {
if(valueLabel !="Empty"){
if (! inputs[i].value)
inputs[i].value = valueLabel;
}else
inputs[i].value = "";
} catch (e) {
//nothing
}
}
}
}
return false;
}
/**
* ********************************* Misc Functions by Neyek ****************************************
*/

View File

@@ -1179,7 +1179,8 @@ class XmlForm_Field_Suggest extends XmlForm_Field_SimpleText //by neyek
if(strlen(trim($formVariableValue))>0) {
$value = $formVariableValue;
}
$str = '<input type="text" '.$storeEntry.' class="module_app_input___gray" style="height:16px" size="'.$this->size.'" id="form[' . $this->name . '_label]" name="form[' . $this->name . '_label]" value="'.$this->htmlentities($value, ENT_COMPAT, 'utf-8').'" ';
$name = "'".$this->name."'";
$str = '<input type="text" '.$storeEntry.' class="module_app_input___gray" style="height:16px" size="'.$this->size.'" id="form[' . $this->name . '_label]" name="form[' . $this->name . '_label]" value="'.$this->htmlentities($value, ENT_COMPAT, 'utf-8').'" onblur="idSet('. $name . ');"';
$str .= $this->NSDependentFields(true).' ';
$str .= '/>';
$str .= '<input ';

View File

@@ -53,16 +53,11 @@
<!-- <td class='FormFieldContent' width="{$form_width}" >{$form.PME_READONLY} </td> //-->
<td class='FormFieldContent' width='{$form_fieldContentWidth}' >{$form.PME_READONLY}</td>
</tr>
<tr>
<td class="FormLabel" width="{$form_labelWidth}">{$PME_DEPENDENTFIELDS}</td>
<!-- <td class='FormFieldContent' width="{$form_width}" >{$form.PME_DEPENDENTFIELDS} </td> //-->
<td class="FormFieldContent" width="{$form_fieldContentWidth}">{$form.PME_DEPENDENTFIELDS}</td>
<tr>
<td class='FormLabel' width="{$form_labelWidth}">{$PME_DEFAULTVALUE}</td>
<!-- <td class='FormFieldContent' width="{$form_width}" >{$form.PME_DEFAULTVALUE} </td> //-->
<td class='FormFieldContent' width='{$form_fieldContentWidth}' >{$form.PME_DEFAULTVALUE}</td>
</tr>
<tr>
<tr>
<td class='FormLabel' width="{$form_labelWidth}">{$PME_SAVELABEL}</td>
<td class='FormFieldContent' width='{$form_fieldContentWidth}' >{$form.PME_SAVELABEL}</td>
</tr>

View File

@@ -53,11 +53,7 @@ SELECT XMLNODE_NAME, TYPE FROM dynaForm WHERE XMLNODE_NAME = @@PME_XMLNODE_NAME
select XMLNODE_NAME, XMLNODE_NAME AS NAME FROM dynaForm WHERE XMLNODE_NAME <> @@PME_XMLNODE_NAME AND XMLNODE_NAME <> "" AND ( TYPE="text" or TYPE="textarea" or TYPE="dropdown" or TYPE="listbox" or TYPE="hidden" or TYPE="suggest")
]]><en>Dependent Fields<option name="">(none)</option></en>
</PME_DEPENDENTFIELDS>
<PME_DEFAULTVALUE type="text" maxlength="" size="30" defaultvalue="" >
<en>Default Value</en>
</PME_DEFAULTVALUE>
<PME_HINT type="textarea" cols="44" rows="1">
<en>Hint</en>
</PME_HINT>