I put a
list.append(str(INPUT(_name='delivery_'+ str(result.id) + "_" +
str(product.id), _value=to_be_delivered, _class="deliver_products",
_type='text')))
for every product per row, can be anything between 1-6 products.
Then I put
list.append(INPUT(_type="image", _src="/init/static/img/
delivery_s.gif", _name="deliverorder_" + str(result.id),
_value=str(result.id))) on every row. There is no variable named
deliverorder_1484 when looking at variables in IE, Firefox shows it.
But IE shows the x and y variables marking at what part of the picture
you selected. I can extract the ordernumber from the name. Before I
didn´t have to ordernumber in the name.
To show the variables I used this:
for var in request.vars:
text += var + ": " + str(request.vars[var]) + '<br>'
return text
On Oct 5, 6:02 am, Bruno Rocha <[email protected]> wrote:
> I Just made a test, look:
>
> <code>
> def index():
> form = FORM()
> inputimg = INPUT(_type="image", \
> _src='myimg.png', \
> _value='testing', \
> _id='ordernumber', \
> _name='ordernumber')
>
> inputname = INPUT(_type='text',_id='name',_name='name')
>
> form.append(inputname)
> form.append(inputimg)
>
> if form.accepts(request.vars, session):
> response.flash = 'form accepted'
> print request.vars
>
> return dict(form=form)
> </code>
>
> I should get the value of ordernumber input, that value is 'testing'
>
> <console result>
> <Storage {'ordernumber.x': '93', 'ordernumber.y': '19', 'name': 'Bruno',
> 'ordernumber': 'testing', '_formkey':
> 'ff678e7d-e2fb-4adc-b48b-00fdf9b3a99a', '_formname': 'default'}>
> </console result>
>
> You can see that 'ordernumber' value are there, 'request.vars.ordernumber'
> should get the value of it.
>
> Independently if you are running I.E or firefox. that variable should be
> there.
>
> You just can't duplicate variable names on the same form.
>
> But, even if you have two or more image buttons, you should have
> request.vars.ordernumber filled with the value of the pressed image.
>
> I tried with I.E, Firefox and Chrome, works well.
>
> Can you share your piece of code?
>
> 2010/10/4 Kenneth <[email protected]>
>
>
>
> > Does anybody know if this is even possible?
>
> > Kenneth
>
> > On 4 loka, 20:04, Kenneth <[email protected]> wrote:
> > > Now I have set the ID but where do I see it when the form is sent?
>
> > > Kenneth
>
> > > On Oct 4, 4:09 pm, Kenneth <[email protected]> wrote:
>
> > > > I set the name, thats where Firefox picks it up, but no ID. I´ll try
> > > > with the ID.
>
> > > > Kenneth
>
> > > > On Oct 4, 4:05 pm, rochacbruno <[email protected]> wrote:
>
> > > > > Did you set "id" and "name" attributes for the INPUT?
>
> > > > > Enviado via iPhone
>
> > > > > Em 04/10/2010, às 09:17, Kenneth <[email protected]>
> > escreveu:
>
> > > > > > Hello,
>
> > > > > > everybody. This is not en web2py problem, I think. But don´t know
> > > > > > where to start looking for a solution.
>
> > > > > > I have a form with a lot of input fields ordered in rows. For every
> > > > > > row I have a submit button. Instead of text in the button I have a
> > > > > > image like tthis. INPUT(_type="image" _src.... _value=ordernumber)
>
> > > > > > With Firefox when I look at the request.vars I get a variable named
> > > > > > ordernumber and the correct value. But IE has no ordernumber
> > > > > > variable.
>
> > > > > > I tried with a input type hidden but as I have maybe 10 submit
> > buttons
> > > > > > i get 10 hidden variables and I don´t know which row should be
> > > > > > processed?
>
> > > > > > If I use _type="submit" I get the variable, but then the submit
> > button
> > > > > > shows the ordernumber value.
>
> > > > > > Any ideas?
>
> > > > > > Kenneth
>
> --
>
> http://rochacbruno.com.br