Web Connection
Web Connection - Sub Domain
Gravatar is a globally recognized avatar based on your email address. Web Connection - Sub Domain
  Edward K. Marois
  All
  Oct 23, 2019 @ 12:50pm
FUNCTION ADD_WORKORER_333()

  SET PROCEDURE TO wutility ADDITIVE
  
  wRCNTRL1 = Request.Params("RCNTRL")

  wPASS2 = Request.Params("TEN_NO") 
  wTEN_NO = VAL(wPASS2) 
  
  SELECT cTENDATA1
  GO TOP
  LOCATE FOR cTENDATA1.TEN_NO = wTEN_NO
  IF FOUND() = .F. THEN
    Response.Write("PROBLEM WITH ADD_WORKORER_333 cTENDATA1.TEN_N " + ALLTRIM(STR(wTEN_NO)))
    RETURN  
  ENDIF
  wAPARTMENT = cTENDATA1.APT

  Response.Write(this.PageHeaderTemplate("Input Request"))

  lcHtml = '<h1>Add a Request - ' 
  lcHtml = lcHtml + ALLTRIM(wPROPERTY)
  lcHtml = lcHtml + ' - '
  lcHtml = lcHtml + ALLTRIM(cTENDATA1.APT)
  lcHtml = lcHtml + ' - '
  lcHtml = lcHtml + ALLTRIM(cTENDATA1.TENNAME)
  lcHtml = lcHtml + '</h1>'

  lcHtml = lcHtml + '<form action="/GET_MAINTAIN_GET.wp" class="form-horizontal container" style="padding: 0 15px 30px;">'
        
  lcHtml = lcHtml + '<div class="input-group">'
  lcHtml = lcHtml + '<div class="input-group-prepend"><span class="input-group-text">Maintenance Request:</span>'
  lcHtml = lcHtml + '</div><textarea input name="wWCOMPLAIN1" class="form-control" aria-label="Maintenance Request:"></textarea></div>'  

  lcHtml = lcHtml + '<h1>' + CHR(13) + CHR(10) + CHR(13) + CHR(10) + '</h1>' 

  lcHtml = lcHtml +'<div>'
  lcHtml = lcHtml +'<select id="ddlViewBy" onchange="example()">'
  lcHtml = lcHtml + '<option value="1">test1</option>'
  lcHtml = lcHtml +'<option value="2" selected="selected">test2</option>'
  lcHtml = lcHtml + '<option value="3">test3</option>'
  lcHtml = lcHtml +'</select>'
  lcHtml = lcHtml + '</div>'

  lcHtml = lcHtml + '<h1>' + CHR(13) + CHR(10) + CHR(13) + CHR(10) + '</h1>' 

  lcHtml = lcHtml +'<div>'
  lcHtml = lcHtml + '<h4 ><span class="label label-primary"  >&times;</span></h4>'
  lcHtml = lcHtml + '<p><input type="text" class="form-control" ID="filter"  style="width:100px" disabled></p>'
  lcHtml = lcHtml + '</div>'

  lcHtml = lcHtml + '<h1>' + CHR(13) + CHR(10) + CHR(13) + CHR(10) + '</h1>' 

  lcHtml = lcHtml + '<div>'     
    
  lcHtml = lcHtml + '<button type="submit" class="btn btn-dark" name="RCNTRL" Value="MRAdd"> Add</button>'
  
  lcHtml = lcHtml + '<button type="submit" class="btn btn-dark" name="RCNTRL" Value="Continue"> Continue</button>'
  
  lcHtml = lcHtml + '</div>'   
  lcHtml = lcHtml + '</form>'

  lcHtml = lcHtml + '<script>;'
  lcHtml = lcHtml + 'function example() {;'
  lcHtml = lcHtml + 'e = document.getElementById("ddlViewBy");'
  lcHtml = lcHtml + 'var strUser = e.options[e.selectedIndex].value;'  
  lcHtml = lcHtml + "('#filter').val(strUser);"   
  lcHtml = lcHtml + '};'
  lcHtml = lcHtml + '</script>'

  Response.Write(lcHtml)
 
  Response.Write(this.PageFooterTemplate())

ENDFUNC

Dear Rick:

As you can see I have made amazing progress

The thing I am having a problem with is that I want to have the results of a HTML 'Option List' selection (though I would like it to be a 'boot strap' "dropdown-menu") to appear in a "label".

For the life of me I cannot get this to work

The

Gravatar is a globally recognized avatar based on your email address. re: Web Connection - Sub Domain
  Rick Strahl
  Edward K. Marois
  Oct 23, 2019 @ 03:31pm

I think what you want is e.value which gets you the selected value for the control - no need to muck with the selected index unless you need the text.

function onChange(ev) {                        
   var el = document.getElementById("lstItems");
   alert(el.value + " " + el.options[el.options.selectedIndex].text);
}

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Web Connection - Sub Domain
  Edward K. Marois
  Edward K. Marois
  Nov 6, 2019 @ 06:02am

Dear Rick:

I get your solution.

For some really odd reason the 'HTML' components will work with a script but the 'Bootstrap' ones are just ignored. They do nothing.

Do you have any idea why this is ???

Gravatar is a globally recognized avatar based on your email address. re: Web Connection - Sub Domain
  Rick Strahl
  Edward K. Marois
  Nov 6, 2019 @ 11:38am

I not sure I understand what you're asking.

+++ Rick ---

© 1996-2019