Javascript question

49 views
Skip to first unread message

Jeffrey Rees

unread,
Sep 11, 2013, 10:15:08 PM9/11/13
to heo-i...@googlegroups.com

Hello I have a question regarding an iform I am working on( see Pic Below) : Basically when the 60 units button is pushed I need the Cardiac (ACS Indication) to go to the indication prompt

When the 80 units button is pushed the indication needs to be Known PE /DVT indication… Also the same for the 12 units button and the 18 units button.

 

I tried building logic saying

 

EDIT,IF,,name of button,NE,,THEN

EDIT,SET,LOCAL,indication,CAT," PTT</= 35 -MAX 4,000 UNITS (ACS)"     (indication is the name of my local variable)… The problem I am finding is the button is just doing the calculations in the .HTM so it does not really equal null.

So then I tried:

EDIT,IF,,nameofbutton,EQ,”60 per kilo or whatever the value is”,THEN

EDIT,SET,local,indication,CAT,”PTT</= 35 -MAX 4,000 UNITS (ACS)”   Still this one does know that the button was pushed it only does the calculation

next I tried:

EDIT,IF,nameoftext box,NE,THEN

EDIT,SET,local,indication,CAT,”PTT</= 35 -MAX 4,000 UNITS (ACS)”   This kind of works but it pulls in all of my logic for each button because again it does not know which button was pushed only the text baox has a value


 

Any help would be much aprreciated

Jeffrey Rees

unread,
Sep 12, 2013, 12:56:46 AM9/12/13
to heo-i...@googlegroups.com
example.JPG

Scott Morris

unread,
Sep 12, 2013, 6:09:34 AM9/12/13
to heo-i...@googlegroups.com
Do these particular buttons submit the form or just perform actions / calculations within the form prior to submit?


On Wednesday, September 11, 2013 10:15:08 PM UTC-4, Jeffrey Rees wrote:

Jeffrey Rees

unread,
Sep 12, 2013, 8:33:49 AM9/12/13
to heo-i...@googlegroups.com, heo-i...@googlegroups.com
They just do the calculations within the iform

Thanks,

Jeffrey Rees

Sent from my iPhone
--
You received this message because you are subscribed to a topic in the Google Groups "HEO iForms" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/heo-iforms/__cQa0x3DIc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to heo-iforms+...@googlegroups.com.
To post to this group, send email to heo-i...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/heo-iforms/ac02246c-ed7e-4caf-9f8a-97707872996d%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Scott Morris

unread,
Sep 12, 2013, 11:07:15 AM9/12/13
to heo-i...@googlegroups.com
Any values that you want to get sent back to the EDIT phase of your VGR need to be contained in an HTML form element.  So, off the top of my head, I see two ways that you could solve this problem.  First, you could replace these dose "buttons" with dose "radio buttons" and attach your javascript to the "onclick" event for each of those.  Then, the selected dose would be saved and sent to the VGR in the radio button form element.  On the other hand, if you or your users really prefer to keep the buttons, you could create a text box and hide it.  Then in the same javascript that updates your other fields, update this hidden text box with the value of the last-clicked dose.  After that's done, you can reference the hidden textbox in your VGR when ordering.

Jeffrey Rees

unread,
Sep 12, 2013, 9:12:08 PM9/12/13
to heo-i...@googlegroups.com
That worked Thank you! I used the hidden text boxes... One more question that is not a huge deal but just thought I would ask; I am not great with javascript so this might be hard ... So each section has 2 buttons that go to 1 text box -  if the user pushes the *60 button it will make that calculation, and if the user pushes the *80 button it will replace the previous calculation and replace it with the new calculation... With the hidden text boxes that I built if the user pushes the button it will then make that hidden box NE,, and then it will send that indication if the user changes their mind and pushes the 2nd button the hidden text bow will still be NE,, is their a way to erase the value in the hidden text box if the other button is pushed? Like I said not a big deal but if there is an easy fix I would appreciate any help? Thanks again

On Wednesday, September 11, 2013 10:15:08 PM UTC-4, Jeffrey Rees wrote:

Any help would be much appreciated

Mark Socks

unread,
Sep 13, 2013, 8:43:01 AM9/13/13
to heo-i...@googlegroups.com
If I'm understanding correctly, and you have 2 buttons setting the values of different textboxes, then you should be able to just set the other to blank with javascript when you set the one to something.

Scott Morris

unread,
Sep 13, 2013, 8:57:41 AM9/13/13
to heo-i...@googlegroups.com
If you have two buttons that go to one text box (let's say for the sake of argument the "60 units / kg" and "80 units / kg"), you could do something as simple as setting your hidden text box to "60" and "80" respectively.  Then in your VGR, instead of checking whether the textbox is empty, you'd check the value of the textbox.  So instead of:

EDIT,IF,,myHiddenTextBox,NE,,THEN
EDIT
,SET,LOCAL,indication,CAT,"yabba dabba doo"

You would do something like:

EDIT,IF,,myHiddenTextBox,EQ,"60",THEN
EDIT
,SET,LOCAL,indication,CAT,"yabba dabba doo"

EDIT
,IF,,myHiddenTextBox,EQ,"80",THEN
EDIT
,SET,LOCAL,indication,CAT,"scooby dooby doo"

Does that make sense?

Reply all
Reply to author
Forward
0 new messages