styhero commited on
Commit
240de79
Β·
verified Β·
1 Parent(s): 3821a45

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -18
app.py CHANGED
@@ -416,28 +416,14 @@ st.markdown("""
416
  # ── Search form ─────────────────────────────────────────────────────────────────
417
 
418
  with st.form("search_form"):
419
- number = st.text_input(
420
- "Mobile number",
421
- placeholder="Enter mobile number β€” e.g. 919876543210",
422
- label_visibility="collapsed",
423
- max_chars=15,
424
- )
425
  submitted = st.form_submit_button("Search", use_container_width=True, type="primary")
426
 
427
- if not submitted:
428
  st.stop()
429
 
430
- # Normalize: strip whitespace, remove +, spaces, dashes
431
- target = "".join(ch for ch in (number or "") if ch.isdigit())
432
-
433
- if not target:
434
- st.warning("Please enter a valid mobile number.")
435
- st.stop()
436
-
437
- # Optional: validate length (Indian numbers are 10 or 12 digits with country code)
438
- if len(target) < 10 or len(target) > 15:
439
- st.warning(f"'{number}' doesn't look like a valid mobile number.")
440
- st.stop()
441
 
442
  # ── Search with progress ────────────────────────────────────────────────────────
443
 
 
416
  # ── Search form ─────────────────────────────────────────────────────────────────
417
 
418
  with st.form("search_form"):
419
+ number = st.text_input("", placeholder="Enter mobile number β€” e.g. 919876543210",
420
+ label_visibility="collapsed")
 
 
 
 
421
  submitted = st.form_submit_button("Search", use_container_width=True, type="primary")
422
 
423
+ if not submitted or not number.strip():
424
  st.stop()
425
 
426
+ target = number.strip()
 
 
 
 
 
 
 
 
 
 
427
 
428
  # ── Search with progress ────────────────────────────────────────────────────────
429