![]() |
QBJS - HTML integration - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1) +--- Forum: QBJS, BAM, and Other BASICs (https://qb64phoenix.com/forum/forumdisplay.php?fid=50) +--- Thread: QBJS - HTML integration (/showthread.php?tid=2172) |
QBJS - HTML integration - misproductions - 11-16-2023 Greetings I'm struggling to work out how to add option select form Elements in qbasic using the. Dom.Bas library. I need individual selectable answers I'm trying to achieve following Print "Example question 1" (show html select options) store ans Print "Example question 2" (show select options) store ans Basically my questions should show selectable options Many thanks RE: QBJS - HTML integration - dbox - 11-16-2023 (11-16-2023, 05:37 PM)misproductions Wrote: I'm struggling to work out how to add option select formHere is an example of creating a simple html form with options. Let me know if this is what you were looking for: RE: QBJS - HTML integration - bplus - 11-16-2023 Is Dom.bas a qbjs thing? Quote:I'm struggling to work out how to add option select form Nice demo dbox! Be nice to do that with my GUI too. Looks to me like dom.bas is not from qbasic. RE: QBJS - HTML integration - dbox - 11-16-2023 (11-16-2023, 09:30 PM)bplus Wrote: Nice demo dbox! Be nice to do that with my GUI too.That's correct @bplus. The Dom library is an extension that is only available in QBJS. RE: QBJS - HTML integration - misproductions - 11-17-2023 (11-16-2023, 06:33 PM)dbox Wrote:(11-16-2023, 05:37 PM)misproductions Wrote: I'm struggling to work out how to add option select formHere is an example of creating a simple html form with options. Let me know if this is what you were looking for: RE: QBJS - HTML integration - dbox - 11-17-2023 (11-17-2023, 03:28 PM)misproductions Wrote: hey is there a way you can hide and show certain dom elements (i know in js and jquery using hide show etc) ? Hey @misproductions, I've updated the sample to show you how to show and hide the dom elements. I've also added a change event to the favorite color option list. Generally speaking, any dom element object that is set from either the Dom.Create or Dom.Get methods has all of the style properties that can be set in Javascript. And there are a lot now! Here's a handy reference: https://www.w3schools.com/jsref/dom_obj_style.asp Similarly, you can create event handler methods for every type of event (that the element supports) with the Dom.Event method. Here's a reference of all the available events: https://www.w3schools.com/jsref/dom_obj_event.asp |